login performance optimization

This commit is contained in:
landaiqing
2024-08-25 00:06:00 +08:00
parent 974a96b6e0
commit 6e47e72514
8 changed files with 149 additions and 145 deletions

View File

@@ -30,3 +30,10 @@ func IsUsername(username string) bool {
match, _ := regexp.MatchString(phoneRegex, username)
return match
}
// IsPassword 密码的正则表达式
func IsPassword(password string) bool {
phoneRegex := `^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{6,18}$`
match, _ := regexp.MatchString(phoneRegex, password)
return match
}