Commit 2acc913f by 胡悦

修改员工新增、编辑密码规则

1 parent 03ea526a
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
maxlength="20" maxlength="20"
required required
lay-verify="required|merchantLoginPassword" lay-verify="required|merchantLoginPassword"
placeholder="请输入密码(必须包含6-20个字母+数字)" placeholder="必须包含字母、数字、下划线、特殊符号中3种或以上"
autocomplete="off" autocomplete="off"
class="layui-input" class="layui-input"
/> />
...@@ -560,11 +560,12 @@ ...@@ -560,11 +560,12 @@
form.verify({ form.verify({
merchantLoginPassword: function (value) { merchantLoginPassword: function (value) {
if (value) { if (value) {
if (value.length < 6 || value.length > 20) { if (value.length < 8 || value.length > 20) {
return '登录密码请填入6-20位字符' return '登录密码请填入8-20位字符'
} }
if (!/^(?=.*\d)(?=.*[a-zA-Z])[\s\S]{6,20}$/.test(value)) { // if (!/^(?=.*\d)(?=.*[a-zA-Z])[\s\S]{6,20}$/.test(value)) {
return '您输入的密码格式不正确,必须同时包含字母、数字。' if (!/^(?=(?:.*[A-Za-z])(?!.*[A-Za-z].*[A-Za-z])).*(?=(?:.*\d)(?!.*\d.*\d)).*(?=(?:.*[_\W_]).*(?!.*[_\W_].*[_\W_])).{8,20}$/.test(value)) {
return '请输入密码(8-20位,必须包含字母、数字、下划线、特殊符号中3种或以上)'
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!