diff --git a/client_mp/store/index.js b/client_mp/store/index.js index 5860176..6ece716 100644 --- a/client_mp/store/index.js +++ b/client_mp/store/index.js @@ -34,12 +34,12 @@ const store = new Vuex.Store({ vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {}, vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '', // vuex_host: 'http://127.0.0.1:8000', - // vuex_api: 'http://127.0.0.1:8000/api', - // vuex_apifile: 'http://127.0.0.1:8000/api/file/', + vuex_api: 'http://127.0.0.1:8000/api', + vuex_apifile: 'http://127.0.0.1:8000/api/file/', vuex_host: 'https://testsearch.ctc.ac.cn', - vuex_api: 'https://testsearch.ctc.ac.cn/api', - vuex_apifile: 'https://testsearch.ctc.ac.cn/api/file/', + // vuex_api: 'https://testsearch.ctc.ac.cn/api', + // vuex_apifile: 'https://testsearch.ctc.ac.cn/api/file/', // 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式 // vuex_version: '1.0.1', diff --git a/server/apps/system/views.py b/server/apps/system/views.py index b3a5bba..85f2e5c 100644 --- a/server/apps/system/views.py +++ b/server/apps/system/views.py @@ -343,9 +343,10 @@ class UserViewSet(PageOrNot, ModelViewSet): code+'&grant_type=authorization_code').content.decode('utf-8') info = json.loads(info) openid = info['openid'] - if UserThird.objects.filter(openid=openid).exists(): - instance = UserThird.objects.get(openid=openid) - instance.openid = openid + instances = UserThird.objects.filter(openid=openid) + if instances.exists(): + instance = instances[0] + instance.user = request.user instance.save() else: UserThird.objects.get_or_create(openid=openid, type='wx_mp', user=request.user, defaults={'openid':openid, 'user':request.user, 'type':'wx_mp'})