|
@@ -12,7 +12,7 @@ import time
|
|
|
from django.db import transaction
|
|
|
|
|
|
from Controller.CheckUserData import RandomStr
|
|
|
-from Model.models import Device_User, Device_Info, DeviceSuperPassword, SysMsgModel
|
|
|
+from Model.models import Device_User, DeviceSuperPassword, SysMsgModel
|
|
|
from Object.RedisObject import RedisObject
|
|
|
from Object.ResponseObject import ResponseObject
|
|
|
from Object.TokenObject import TokenObject
|
|
@@ -35,10 +35,12 @@ class SuperPasswordView(View):
|
|
|
return self.validation(request_dict, request, operation)
|
|
|
|
|
|
def validation(self, request_dict, request, operation):
|
|
|
- token = TokenObject(request.META.get('HTTP_AUTHORIZATION'))
|
|
|
- lang = request_dict.get('lang', token.lang)
|
|
|
- response = ResponseObject(lang)
|
|
|
- userID = token.userID
|
|
|
+ token = request_dict.get('token', None)
|
|
|
+ response = ResponseObject()
|
|
|
+ tko = TokenObject(token)
|
|
|
+ if tko.code != 0:
|
|
|
+ return response.json(tko.code)
|
|
|
+ userID = tko.userID
|
|
|
if operation == 'getAuthorizationCode': # 用户提交请求
|
|
|
return self.getAuthorizationCode(request_dict, response, userID)
|
|
|
if operation == 'customerServiceManagement': # 审核用户请求/生成超级密码
|
|
@@ -197,6 +199,8 @@ class SuperPasswordView(View):
|
|
|
authcode = request_dict.get('authcode', None)
|
|
|
if authcode:
|
|
|
authcode = CommonService.decode_data(authcode)
|
|
|
+ if not len(authcode) == 6:
|
|
|
+ return response.json(121)
|
|
|
super_password_id = 'super_password_' + userID
|
|
|
redisObj = RedisObject()
|
|
|
# redis里面的验证码
|