Browse Source

优化验证码修改密码

peng 1 year ago
parent
commit
7d0f49a627
1 changed files with 3 additions and 2 deletions
  1. 3 2
      Controller/UserController.py

+ 3 - 2
Controller/UserController.py

@@ -3390,7 +3390,8 @@ class SingleLoginView(TemplateView):
         if data_valid.email_validate(email) is False:
             return response.json(107)
         reds = RedisObject()
-        identifying_code = reds.get_data(key=email + '_SingleLogin')
+        key = email + '_SingleLogin'
+        identifying_code = reds.get_data(key=key)
         # 是否以获取邮箱验证码
         if identifying_code:
             return response.json(89)
@@ -3411,7 +3412,7 @@ class SingleLoginView(TemplateView):
         )
         if send_res is not True:
             return response.json(44)
-        if reds.set_data(key=email + '_SingleLogin', val=identifying_code, expire=600) is not True:
+        if reds.set_data(key=key, val=identifying_code, expire=600) is not True:
             return response.json(10, 'error')
         return response.json(0)