Commit 277d5847 authored by Davve's avatar Davve

修改明星错误

parent cce80f95
......@@ -52,19 +52,15 @@ class CelebrityUpdateOrCreate(APIView):
def post(self, request):
id = request.POST.get('id', '')
print(request.POST, '----')
gender = request.POST.get('gender')
group_ids = list(set(map(lambda x: x.split(":")[0], json.loads(request.POST.get('groups', '[]')))))
updates = {
'group_ids': '',
'gender': ''
}
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)
else:
updates['group_ids'] = list(set(json.loads(request.POST.get('groups', '[]'))))
if gender == '男':
updates['gender'] = 0
elif gender == '女':
......@@ -77,7 +73,7 @@ class CelebrityUpdateOrCreate(APIView):
'is_online': int(request.POST.get('is_online')),
'desc': request.POST.get('description'),
'portrait': request.POST.get('avatar')[:-2],
'group_ids': updates['group_ids'],
'group_ids': group_ids,
}
try:
self.rpc['venus/sun/celebrity/edit'](id=id, data=data).unwrap()
......
......@@ -387,7 +387,7 @@
fetchStarRelatedGroup(this.listQuery).then(response => {
let rep = response.data.data.data;
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.total = response.data.data.total
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment