Sfoglia il codice sorgente

修改token获取方式

guanhailong 2 anni fa
parent
commit
00bbecce30
1 ha cambiato i file con 4 aggiunte e 6 eliminazioni
  1. 4 6
      Controller/AppAccountManagement.py

+ 4 - 6
Controller/AppAccountManagement.py

@@ -35,14 +35,12 @@ class AppAccoutView(View):
         return self.validation(request_dict, request, operation)
 
     def validation(self, request_dict, request, operation):
-        token = request_dict.get('token', None)
-        response = ResponseObject()
-        if token is None:
-            return response.json(309)
-        token = TokenObject(token)
+        token = TokenObject(request.META.get('HTTP_AUTHORIZATION'))
+        lang = request_dict.get('lang', token.lang)
+        response = ResponseObject(lang)
+        userID = token.userID
         if token.code != 0:
             return response.json(token.code)
-        userID = token.userID
         if operation == 'getAuthorizationCode':  # 获取用户请求/生成授权码
             return self.getAuthorizationCode(request_dict, response, userID)
         if operation == 'customerServiceManagement':  # 编辑超级密码请求表