From a72a7a7c6981c3eaa83b0487d81da462c6de68ee Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Wed, 9 Apr 2025 14:35:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8E=BB=E9=99=A4=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E5=85=81=E8=AE=B8=E5=AF=86=E7=A0=815?= =?UTF-8?q?=E4=BD=8D=20admin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/framework/utils/regular/regular.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/framework/utils/regular/regular.go b/src/framework/utils/regular/regular.go index 3eeb31c6..c27cb08e 100644 --- a/src/framework/utils/regular/regular.go +++ b/src/framework/utils/regular/regular.go @@ -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 }