perf: 用户密码校验规则

This commit is contained in:
fit2cloud-chenyw 2025-01-20 16:38:14 +08:00 committed by ulleo
parent eae69aabad
commit 4a09187e83

View File

@ -22,7 +22,7 @@ const validatePwd = (_: any, value: any, callback: any) => {
callback(new Error(t('system.be_the_same')))
}
const pattern =
/^.*(?=.{8,20})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[~!@#$%^&*()_+\-\={}|":<>?`[\];',.\/])[a-zA-Z0-9~!@#$%^&*()_+\-\={}|":<>?`[\];',.\/]*$/
/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[~!@#$%^&*()_+\-\={}|":<>?`[\];',.\/])[a-zA-Z0-9~!@#$%^&*()_+\-\={}|":<>?`[\];',.\/]{8,20}$/
const regep = new RegExp(pattern)
if (!regep.test(value)) {
const msg = t('user.pwd_pattern_error')