Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
sun
Commits
277d5847
Commit
277d5847
authored
Dec 05, 2018
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改明星错误
parent
cce80f95
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
star.py
api/star.py
+3
-7
StarDetail.vue
vu/src/views/star/components/StarDetail.vue
+1
-1
No files found.
api/star.py
View file @
277d5847
...
@@ -52,19 +52,15 @@ class CelebrityUpdateOrCreate(APIView):
...
@@ -52,19 +52,15 @@ class CelebrityUpdateOrCreate(APIView):
def
post
(
self
,
request
):
def
post
(
self
,
request
):
id
=
request
.
POST
.
get
(
'id'
,
''
)
id
=
request
.
POST
.
get
(
'id'
,
''
)
print
(
request
.
POST
,
'----'
)
gender
=
request
.
POST
.
get
(
'gender'
)
gender
=
request
.
POST
.
get
(
'gender'
)
group_ids
=
list
(
set
(
map
(
lambda
x
:
x
.
split
(
":"
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'groups'
,
'[]'
)))))
updates
=
{
updates
=
{
'group_ids'
:
''
,
'gender'
:
''
'gender'
:
''
}
}
if
not
id
:
if
not
id
:
group_ids
=
list
(
set
(
map
(
lambda
x
:
x
.
split
(
":"
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'groups'
,
'[]'
)))))
updates
[
'group_ids'
]
=
group_ids
updates
[
'gender'
]
=
int
(
gender
)
updates
[
'gender'
]
=
int
(
gender
)
else
:
else
:
updates
[
'group_ids'
]
=
list
(
set
(
json
.
loads
(
request
.
POST
.
get
(
'groups'
,
'[]'
))))
if
gender
==
'男'
:
if
gender
==
'男'
:
updates
[
'gender'
]
=
0
updates
[
'gender'
]
=
0
elif
gender
==
'女'
:
elif
gender
==
'女'
:
...
@@ -77,7 +73,7 @@ class CelebrityUpdateOrCreate(APIView):
...
@@ -77,7 +73,7 @@ class CelebrityUpdateOrCreate(APIView):
'is_online'
:
int
(
request
.
POST
.
get
(
'is_online'
)),
'is_online'
:
int
(
request
.
POST
.
get
(
'is_online'
)),
'desc'
:
request
.
POST
.
get
(
'description'
),
'desc'
:
request
.
POST
.
get
(
'description'
),
'portrait'
:
request
.
POST
.
get
(
'avatar'
)[:
-
2
],
'portrait'
:
request
.
POST
.
get
(
'avatar'
)[:
-
2
],
'group_ids'
:
updates
[
'group_ids'
]
,
'group_ids'
:
group_ids
,
}
}
try
:
try
:
self
.
rpc
[
'venus/sun/celebrity/edit'
](
id
=
id
,
data
=
data
)
.
unwrap
()
self
.
rpc
[
'venus/sun/celebrity/edit'
](
id
=
id
,
data
=
data
)
.
unwrap
()
...
...
vu/src/views/star/components/StarDetail.vue
View file @
277d5847
...
@@ -387,7 +387,7 @@
...
@@ -387,7 +387,7 @@
fetchStarRelatedGroup
(
this
.
listQuery
).
then
(
response
=>
{
fetchStarRelatedGroup
(
this
.
listQuery
).
then
(
response
=>
{
let
rep
=
response
.
data
.
data
.
data
;
let
rep
=
response
.
data
.
data
.
data
;
for
(
let
i
=
0
;
i
<
rep
.
length
;
i
++
){
for
(
let
i
=
0
;
i
<
rep
.
length
;
i
++
){
this
.
group_ids
.
push
(
rep
[
i
].
id
)
this
.
group_ids
.
push
(
rep
[
i
].
id
+
':'
+
rep
[
i
].
name
)
}
}
this
.
tableData
=
response
.
data
.
data
.
data
this
.
tableData
=
response
.
data
.
data
.
data
this
.
total
=
response
.
data
.
data
.
total
this
.
total
=
response
.
data
.
data
.
total
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment