Sfoglia il codice sorgente

pc端发/app端发出的token都可验证

guanhailong 2 anni fa
parent
commit
9cf8a1b08d
1 ha cambiato i file con 5 aggiunte e 2 eliminazioni
  1. 5 2
      Controller/SuperPasswordTool.py

+ 5 - 2
Controller/SuperPasswordTool.py

@@ -39,7 +39,11 @@ class SuperPasswordView(View):
         response = ResponseObject()
         tko = TokenObject(token)
         if tko.code != 0:
-            return response.json(tko.code)
+            tko = TokenObject(
+                request.META.get('HTTP_AUTHORIZATION'))
+            if tko.code != 0:
+                return response.json(tko.code)
+            response.lang = tko.lang
         userID = tko.userID
         if operation == 'getAuthorizationCode':  # 用户提交请求
             return self.getAuthorizationCode(request_dict, response, userID)
@@ -114,7 +118,6 @@ class SuperPasswordView(View):
                 if not device_super_password_qs.exists():
                     return response.json(173)
                 status = int(status)
-                authcode = ''
                 if status == 1:
                     # 验证码生成
                     super_code = RandomStr(6, True)