Browse Source

邮箱获取验证码修改每60秒一次

zhangdongming 1 year ago
parent
commit
ce5438ae3e
2 changed files with 4 additions and 4 deletions
  1. 2 2
      Controller/UserController.py
  2. 2 2
      Service/TemplateService.py

+ 2 - 2
Controller/UserController.py

@@ -857,7 +857,7 @@ class v2authCodeView(TemplateView):
         identifyingCode = reds.get_data(key=email + '_identifyingCode')
         # 是否以获取邮箱验证码
         if identifyingCode:
-            return response.json(89)
+            return response.json(0)
         user_qs = Device_User.objects.filter(username=email)
         email_qs = Device_User.objects.filter(userEmail=email)
         # 邮箱用户是否已存在
@@ -878,7 +878,7 @@ class v2authCodeView(TemplateView):
         )
         if send_res is not True:
             return response.json(44)
-        if reds.set_data(key=email + '_identifyingCode', val=identifyingCode, expire=600) is not True:
+        if reds.set_data(key=email + '_identifyingCode', val=identifyingCode, expire=60) is not True:
             return response.json(10, 'error')
         return response.json(0)
 

+ 2 - 2
Service/TemplateService.py

@@ -31,7 +31,7 @@ class TemplateService:
 <div class="content"
      style="overflow: hidden;padding:30px 10% 70px 10%;margin:0 10%;background-color: #fff;box-shadow:0 4px 20px rgba(0,0,0,0.1);word-break: break-all;">
     <h2 style="margin: 30px 0;">Hello, {username}</h2>
-    <p style="margin-bottom: 40px;">请输入验证码完成注册,有效期10分钟:</p>
+    <p style="margin-bottom: 40px;">请输入验证码完成注册,有效期1分钟:</p>
     <span style="padding: 10px 20px; font-size: 24px;background-color: #EB6F5A;border-radius:4px;color:#fff;">{captcha}</span>
 </div>
 </body>
@@ -51,7 +51,7 @@ class TemplateService:
 <div class="content"
      style="overflow: hidden;padding:30px 10% 70px 10%;margin:0 10%;background-color: #fff;box-shadow:0 4px 20px rgba(0,0,0,0.1);word-break: break-all;">
     <h2 style="margin: 30px 0;">Hello, {username}</h2>
-    <p style="margin-bottom: 40px;">Please input code to reg. only valid in 10 minutes!</p>
+    <p style="margin-bottom: 40px;">Please input code to reg. only valid in 1 minutes!</p>
     <span style="padding: 10px 20px; font-size: 24px;background-color: #EB6F5A;border-radius:4px;color:#fff;">{captcha}</span>
 </div>
 </body>