|
@@ -1359,17 +1359,14 @@ class v2forgetPwdCodeView(TemplateView):
|
|
user_qs = Device_User.objects.filter(Q(phone=phone) | Q(username=phone))
|
|
user_qs = Device_User.objects.filter(Q(phone=phone) | Q(username=phone))
|
|
if not user_qs.exists():
|
|
if not user_qs.exists():
|
|
return response.json(102)
|
|
return response.json(102)
|
|
- users = user_qs[0]
|
|
|
|
|
|
+ users = user_qs.values().first()
|
|
res = {}
|
|
res = {}
|
|
reds = RedisObject()
|
|
reds = RedisObject()
|
|
reds_key = str(phone) + '_forgetPwdResetCode'
|
|
reds_key = str(phone) + '_forgetPwdResetCode'
|
|
resetCode = reds.get_data(key=reds_key)
|
|
resetCode = reds.get_data(key=reds_key)
|
|
reds_key_ttl = reds.get_ttl(key=reds_key)
|
|
reds_key_ttl = reds.get_ttl(key=reds_key)
|
|
if reds_key_ttl > 240 and resetCode:
|
|
if reds_key_ttl > 240 and resetCode:
|
|
- # if identifyingCode :
|
|
|
|
return response.json(90)
|
|
return response.json(90)
|
|
- # if resetCode is True:
|
|
|
|
- # return response.json(120)
|
|
|
|
resetCode = RandomStr(6, True)
|
|
resetCode = RandomStr(6, True)
|
|
if sign_name == 'zosi':
|
|
if sign_name == 'zosi':
|
|
sign_ms = '周视'
|
|
sign_ms = '周视'
|
|
@@ -1421,7 +1418,7 @@ class v2forgetPwdCodeView(TemplateView):
|
|
user_qs = Device_User.objects.filter(Q(phone=phone) | Q(username=phone))
|
|
user_qs = Device_User.objects.filter(Q(phone=phone) | Q(username=phone))
|
|
if not user_qs.exists():
|
|
if not user_qs.exists():
|
|
return response.json(102)
|
|
return response.json(102)
|
|
- users = user_qs[0]
|
|
|
|
|
|
+ users = user_qs.values().first()
|
|
res = {}
|
|
res = {}
|
|
reds = RedisObject()
|
|
reds = RedisObject()
|
|
reds_key = str(phone) + '_forgetPwdResetCode'
|
|
reds_key = str(phone) + '_forgetPwdResetCode'
|
|
@@ -1491,7 +1488,7 @@ class v2forgetPwdCodeView(TemplateView):
|
|
user_qs = Device_User.objects.filter(Q(userEmail=email) | Q(username=email))
|
|
user_qs = Device_User.objects.filter(Q(userEmail=email) | Q(username=email))
|
|
if not user_qs.exists():
|
|
if not user_qs.exists():
|
|
return response.json(104)
|
|
return response.json(104)
|
|
- users = user_qs[0]
|
|
|
|
|
|
+ users = user_qs.values().first()
|
|
res = {}
|
|
res = {}
|
|
reds = RedisObject()
|
|
reds = RedisObject()
|
|
resetCode = reds.get_data(key=email + '_forgetPwdResetCode')
|
|
resetCode = reds.get_data(key=email + '_forgetPwdResetCode')
|