This commit is contained in:
ping 2026-05-12 15:57:25 +08:00
parent b08d6a02aa
commit 4b68d8ea33

View File

@ -26,8 +26,9 @@ async def registerUser(ns):
ns['username'] = ns['mobile']
if ns.get('password'):
if len(ns.get('password')) < 6:
return {'status': False, 'msg': '密码必须6位数以上'}
# 至少8位包含大小写字母、特殊字符、数字
if len(ns.get('password')) < 8 or not re.search(r'[a-zA-Z]', ns.get('password')) or not re.search(r'[0-9]', ns.get('password')) or not re.search(r'[!@#$%^&*()_+{}|:"<>?]', ns.get('password')):
return {'status': False, 'msg': '密码至少8位包含大小写字母、特殊字符、数字'}
if not ns.get('codeid'):
return {'status': False, 'msg': '验证码ID不能为空'}