调整接单密码强度规则

This commit is contained in:
yml2213
2026-08-20 16:19:44 +08:00
parent 218ee1577e
commit d2512ccb6b
5 changed files with 30 additions and 31 deletions
+4 -7
View File
@@ -1,15 +1,12 @@
export const WORKER_PASSWORD_MIN_LENGTH = 6
export const WORKER_PASSWORD_MIN_LENGTH = 8
export const WORKER_PASSWORD_RULE_MESSAGE =
'密码至少 6 位,且必须包含大写字母、小写字母、数字和标点符号'
export const WORKER_PASSWORD_RULE_MESSAGE = '密码至少 8 位,且必须包含英文字母和数字'
export function isWorkerPasswordStrong(value: unknown): boolean {
const password = String(value || '')
return (
password.length >= WORKER_PASSWORD_MIN_LENGTH &&
/[A-Z]/.test(password) &&
/[a-z]/.test(password) &&
/\d/.test(password) &&
/[\p{P}\p{S}]/u.test(password)
/[a-zA-Z]/.test(password) &&
/\d/.test(password)
)
}