浏览代码

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

guanhailong 2 年之前
父节点
当前提交
9cf8a1b08d
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      Controller/SuperPasswordTool.py

+ 5 - 2
Controller/SuperPasswordTool.py

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