From 704ca750599084f8c71b9496236423bd4b401ed1 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 3 Apr 2025 17:55:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E7=AD=96=E7=95=A5=E6=9C=80=E5=B0=8F=E9=95=BF=E5=BA=A6=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/system/service/sys_user.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/system/service/sys_user.go b/src/modules/system/service/sys_user.go index 93c87ee2..1f734149 100644 --- a/src/modules/system/service/sys_user.go +++ b/src/modules/system/service/sys_user.go @@ -287,6 +287,11 @@ func (s SysUser) ValidatePasswordPolicy(password string, errLang string) (bool, "uppercase": policy.Uppercase, "lowercase": policy.Lowercase, }) + + if len(password) < policy.MinLength { + return false, errMsg + } + specialChars := len(regexp.MustCompile(`[!@#$%^&*(),.?":{}|<>]`).FindAllString(password, -1)) if specialChars < policy.SpecialChars { return false, errMsg