feat: migrate app routes and business modules
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
export const PASSWORD_POLICY_MESSAGE =
|
||||
"密码需为 8–32 位,并同时包含字母和数字";
|
||||
|
||||
export const validatePassword = (value) => {
|
||||
const valid =
|
||||
typeof value === "string" &&
|
||||
value.length >= 8 &&
|
||||
value.length <= 32 &&
|
||||
/[A-Za-z]/.test(value) &&
|
||||
/\d/.test(value);
|
||||
|
||||
return { valid, message: valid ? "" : PASSWORD_POLICY_MESSAGE };
|
||||
};
|
||||
Reference in New Issue
Block a user