fix:密码校验格式统一
This commit is contained in:
@@ -126,7 +126,7 @@ onMounted(() => {
|
||||
total: deviceList.length,
|
||||
pageSize: 10,
|
||||
showSizeChanger: false,
|
||||
showTotal: (total) => `共 ${total} 条`
|
||||
showTotal: (total) => `${t('page.carddata.total')} ${total} `
|
||||
}"
|
||||
>
|
||||
</a-table>
|
||||
|
||||
@@ -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-z0-9]+$)(?![a-z0-9\W]+$)(?![A-Za-z\W]+$)(?![A-Z0-9\W]+$)[a-zA-Z0-9\W]{6,}$/.test(value)) {
|
||||
return Promise.reject(t('page.login.register.passwordFormat'));
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user