修改密码复杂度
This commit is contained in:
@@ -9,7 +9,7 @@ export const REG_PHONE = /^.{3,}$/;
|
||||
*
|
||||
* 6-18 characters, including letters, numbers, and underscores
|
||||
*/
|
||||
export const REG_PWD = /^\w{6,18}$/;
|
||||
export const REG_PWD = /^[A-Za-z0-9_!@#$%^&*(),.?":{}|<>]{6,18}$/;
|
||||
|
||||
/** Email reg */
|
||||
export const REG_EMAIL = ///^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
|
||||
|
||||
@@ -58,9 +58,9 @@ const formRules = computed<Record<string, Rule | Rule[]>>(() => {
|
||||
return Promise.reject(t('page.login.register.passwordLength'));
|
||||
}
|
||||
// 格式验证:必须包含字母和数字
|
||||
if (!/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,20}$/.test(value)) {
|
||||
return Promise.reject(t('page.login.register.passwordFormat'));
|
||||
}
|
||||
// if (!/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,20}$/.test(value)) {
|
||||
// return Promise.reject(t('page.login.register.passwordFormat'));
|
||||
// }
|
||||
return Promise.resolve();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user