remove collect
This commit is contained in:
parent
1a5ce792fe
commit
284100841d
|
@ -48,9 +48,9 @@ App({
|
||||||
globalData: {
|
globalData: {
|
||||||
userInfo: null,
|
userInfo: null,
|
||||||
userinfo: null, // 服务器传回的消费者信息
|
userinfo: null, // 服务器传回的消费者信息
|
||||||
host: 'https://apitest.ctcshe.com/api/',
|
// host: 'https://apitest.ctcshe.com/',
|
||||||
mediahost: 'https://apitest.ctcshe.com/',
|
mediahost: 'https://apitest.ctcshe.com/',
|
||||||
// host: 'http://127.0.0.1:8000/api/',
|
host: 'http://127.0.0.1:8000/',
|
||||||
// mediahost: 'http://127.0.0.1:8000/',
|
// mediahost: 'http://127.0.0.1:8000/',
|
||||||
token : '',
|
token : '',
|
||||||
subject:null,
|
subject:null,
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
"window": {
|
"window": {
|
||||||
"backgroundTextStyle": "light",
|
"backgroundTextStyle": "light",
|
||||||
"navigationBarBackgroundColor": "#fff",
|
"navigationBarBackgroundColor": "#fff",
|
||||||
"navigationBarTitleText": "刷题",
|
"navigationBarTitleText": "中科辐射学堂",
|
||||||
"navigationBarTextStyle": "black"
|
"navigationBarTextStyle": "black"
|
||||||
},
|
},
|
||||||
"tabBar": {
|
"tabBar": {
|
||||||
|
|
|
@ -132,7 +132,7 @@ class ConsumerViewSet(ModelViewSet):
|
||||||
else:
|
else:
|
||||||
return Response({'error':result['data']})
|
return Response({'error':result['data']})
|
||||||
|
|
||||||
@action(methods=['post','delete', 'get'], detail=False, permission_classes=[], authentication_classes=[ConsumerTokenAuthentication],
|
@action(methods=['post','delete','get'], detail=False, permission_classes=[], authentication_classes=[ConsumerTokenAuthentication],
|
||||||
url_path='collects', url_name='create_collects')
|
url_path='collects', url_name='create_collects')
|
||||||
def collects(self, request):
|
def collects(self, request):
|
||||||
'''
|
'''
|
||||||
|
@ -150,7 +150,7 @@ class ConsumerViewSet(ModelViewSet):
|
||||||
queryset = request.user.collects.all().order_by('-update_time')
|
queryset = request.user.collects.all().order_by('-update_time')
|
||||||
serializer = QuestionSerializer(instance=queryset,many=True)
|
serializer = QuestionSerializer(instance=queryset,many=True)
|
||||||
return Response(serializer.data)
|
return Response(serializer.data)
|
||||||
else:
|
elif request.method == 'DELETE':
|
||||||
questionId = request.data.get('question',None)
|
questionId = request.data.get('question',None)
|
||||||
if questionId:
|
if questionId:
|
||||||
request.user.collects.remove(questionId)
|
request.user.collects.remove(questionId)
|
||||||
|
|
Loading…
Reference in New Issue