Pārlūkot izejas kodu

优化注册获取验证码

zhangdongming 1 gadu atpakaļ
vecāks
revīzija
aff13f7afa

+ 1 - 1
Controller/UserController.py

@@ -924,7 +924,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)
 

+ 4 - 2
Object/ResponseObject.py

@@ -146,7 +146,8 @@ class ResponseObject(object):
             10070: 'This device sharing limit has been reached',
             503: 'The operation failed, please try again later',
             10071: 'The successful collection can be viewed in Settings - 4G-My package',
-            10072: 'This function has been disabled. Please contact the administrator'
+            10072: 'This function has been disabled. Please contact the administrator',
+            10073: 'The verification code has been sent, please pay attention to check'
         }
         data_cn = {
             0: '成功',
@@ -279,7 +280,8 @@ class ResponseObject(object):
             10070: '此设备分享已达上限',
             503: '操作失败,请稍后重试',
             10071: '\t领取成功\n可在设置-4G-我的套餐中查看',
-            10072: '该功能已停用,请联系管理员'
+            10072: '该功能已停用,请联系管理员',
+            10073: '验证码已发送,请注意查收'
         }
 
         msg = data_cn if self.lang == 'cn' or self.lang == 'zh-Hans' or self.lang == 'zh-Hant' else data_en

+ 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>