|
@@ -6,6 +6,7 @@ from Controller.CheckUserData import DataValid
|
|
from Object.RedisObject import RedisObject
|
|
from Object.RedisObject import RedisObject
|
|
from Object.ResponseObject import ResponseObject
|
|
from Object.ResponseObject import ResponseObject
|
|
from Object.TokenObject import TokenObject
|
|
from Object.TokenObject import TokenObject
|
|
|
|
+from Service.CommonService import CommonService
|
|
|
|
|
|
|
|
|
|
class VerifyCodeView(View):
|
|
class VerifyCodeView(View):
|
|
@@ -22,12 +23,12 @@ class VerifyCodeView(View):
|
|
return self.validate(request_dict, operation)
|
|
return self.validate(request_dict, operation)
|
|
|
|
|
|
def validate(self, request_dict, operation):
|
|
def validate(self, request_dict, operation):
|
|
- # token = TokenObject(request_dict.get('token', None))
|
|
|
|
|
|
+ token = TokenObject(request_dict.get('token', None))
|
|
|
|
|
|
response = ResponseObject()
|
|
response = ResponseObject()
|
|
|
|
|
|
- # if token.code != 0:
|
|
|
|
- # return response.json(token.code)
|
|
|
|
|
|
+ if token.code != 0:
|
|
|
|
+ return response.json(token.code)
|
|
|
|
|
|
if operation == 'forget':
|
|
if operation == 'forget':
|
|
return self.verify_forget(request_dict, response)
|
|
return self.verify_forget(request_dict, response)
|
|
@@ -43,6 +44,12 @@ class VerifyCodeView(View):
|
|
phone = request_dict.get('phone', None)
|
|
phone = request_dict.get('phone', None)
|
|
authcode = request_dict.get('authcode', None)
|
|
authcode = request_dict.get('authcode', None)
|
|
key = '_forgetPwdResetCode'
|
|
key = '_forgetPwdResetCode'
|
|
|
|
+
|
|
|
|
+ if authcode is None:
|
|
|
|
+ return response.json(444)
|
|
|
|
+
|
|
|
|
+ authcode = CommonService.decode_data(authcode)
|
|
|
|
+
|
|
if email is not None:
|
|
if email is not None:
|
|
email = email.strip()
|
|
email = email.strip()
|
|
return self.email_validate(key, email, authcode, response)
|
|
return self.email_validate(key, email, authcode, response)
|
|
@@ -57,6 +64,11 @@ class VerifyCodeView(View):
|
|
phone = request_dict.get('phone', None)
|
|
phone = request_dict.get('phone', None)
|
|
authcode = request_dict.get('authcode', None)
|
|
authcode = request_dict.get('authcode', None)
|
|
key = '_identifyingCode'
|
|
key = '_identifyingCode'
|
|
|
|
+ if authcode is None:
|
|
|
|
+ return response.json(444)
|
|
|
|
+
|
|
|
|
+ authcode = CommonService.decode_data(authcode)
|
|
|
|
+
|
|
if email is not None:
|
|
if email is not None:
|
|
email = email.strip()
|
|
email = email.strip()
|
|
return self.email_validate(key, email, authcode, response)
|
|
return self.email_validate(key, email, authcode, response)
|
|
@@ -71,6 +83,8 @@ class VerifyCodeView(View):
|
|
authcode = request_dict.get('authcode', None)
|
|
authcode = request_dict.get('authcode', None)
|
|
|
|
|
|
if imageCodeId and authcode:
|
|
if imageCodeId and authcode:
|
|
|
|
+
|
|
|
|
+ authcode = CommonService.decode_data(authcode)
|
|
image_code_key = 'image_code_' + imageCodeId
|
|
image_code_key = 'image_code_' + imageCodeId
|
|
redisObj = RedisObject(db=6)
|
|
redisObj = RedisObject(db=6)
|
|
# redis里面的验证码
|
|
# redis里面的验证码
|