Forráskód Böngészése

密码正则校验

peng 1 éve
szülő
commit
fe6e36f671
2 módosított fájl, 3 hozzáadás és 3 törlés
  1. 1 1
      Controller/CheckUserData.py
  2. 2 2
      Object/ResponseObject.py

+ 1 - 1
Controller/CheckUserData.py

@@ -41,7 +41,7 @@ class DataValid:
         # self.re_name = re.compile(r'^[A-Za-z0-9\u4e00-\u9fa5\.\_]{1,16}$')
         self.re_name = re.compile(r'^[A-Za-z0-9\u4e00-\u9fa5\.\_\-\@]{4,64}$')
         # 密码强度正则
-        self.re_password = re.compile(r'^[\w\.\_\@\-]{1,16}$')
+        self.re_password = re.compile(r'^[\w\.\_\@\-\#\$\%\^\&\+\=]{6,16}$')
         # 手机号码正则
         self.re_mobile = re.compile(r'^\d{1,16}$')
         # 邮箱地址正则

+ 2 - 2
Object/ResponseObject.py

@@ -36,7 +36,7 @@ class ResponseObject(object):
             106: 'Illegal profile picture!',
             107: 'The username not conform to the rules!',
             108: 'Illegal nickname!',
-            109: 'The password not conform to the rules!',
+            109: 'Only supports letters, numbers, and special characters._@-#$%^&+=',
             110: 'user doesn\'t activated',
             111: 'Error password',
             112: 'Fingerprint login is not turned on',
@@ -173,7 +173,7 @@ class ResponseObject(object):
             106: '头像违规!',
             107: '用户名格式不符合!',
             108: '用户昵称违规!',
-            109: '密码格式不符合!',
+            109: '只支持字母,数字,特殊字符._@-#$%^&+=',
             110: '用户未激活!',
             111: '密码不正确!',
             112: '未开通指纹登录',