fix: 去除密码校验允许密码5位 admin
This commit is contained in:
@@ -34,9 +34,11 @@ func ValidPassword(password string) bool {
|
||||
if password == "" {
|
||||
return false
|
||||
}
|
||||
pattern := `^(?![A-Za-z0-9]+$)(?![a-z0-9\W]+$)(?![A-Za-z\W]+$)(?![A-Z0-9\W]+$)[a-zA-Z0-9\W]{6,}$`
|
||||
re := regexp2.MustCompile(pattern, 0)
|
||||
match, err := re.MatchString(password)
|
||||
// pattern := `^(?![A-Za-z0-9]+$)(?![a-z0-9\W]+$)(?![A-Za-z\W]+$)(?![A-Z0-9\W]+$)[a-zA-Z0-9\W]{6,}$`
|
||||
// re := regexp2.MustCompile(pattern, 0)
|
||||
// match, err := re.MatchString(password)
|
||||
pattern := `^.{5,}$`
|
||||
match, err := regexp.MatchString(pattern, password)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user