Commit dc0b8fa2 by 张立顺

fix bug

1 parent a211785a
...@@ -453,11 +453,16 @@ export default { ...@@ -453,11 +453,16 @@ export default {
{ required: true, message: "请输入登录密码" }, { required: true, message: "请输入登录密码" },
{ {
validator(rule, value, callback) { validator(rule, value, callback) {
if (!/^[A-Za-z0-9]{6,20}$/.test(value)) { const v = value == null ? "" : String(value);
if (
!/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,20}$/.test(
v,
)
) {
callback( callback(
new Error( new Error(
"登录密码须为6-20位字母与数字组合" "登录密码须为6-20位,仅字母与数字且须同时包含字母与数字",
) ),
); );
return false; return false;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!