From c5e6ba13af068b504eab9e6d8f6711e7d3f673c3 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 17 Oct 2023 14:20:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=86=E7=A0=81=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E9=87=8D=E8=AF=95=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/common/service/account.impl.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/common/service/account.impl.go b/src/modules/common/service/account.impl.go index 82d0c8f6..a598a833 100644 --- a/src/modules/common/service/account.impl.go +++ b/src/modules/common/service/account.impl.go @@ -128,11 +128,12 @@ func (s *AccountImpl) passwordRetryCount(username string) (string, int64, time.D retryCount = "0" } // 是否超过错误值 - if parse.Number(retryCount) >= int64(maxRetryCount) { + retryCountInt64 := parse.Number(retryCount) + if retryCountInt64 >= int64(maxRetryCount) { msg := fmt.Sprintf("密码输入错误 %d 次,帐户锁定 %d 分钟", maxRetryCount, lockTime) - return retrykey, int64(maxRetryCount), time.Duration(lockTime) * time.Minute, errors.New(msg) + return retrykey, retryCountInt64, time.Duration(lockTime) * time.Minute, errors.New(msg) } - return retrykey, int64(maxRetryCount), time.Duration(lockTime) * time.Minute, nil + return retrykey, retryCountInt64, time.Duration(lockTime) * time.Minute, nil } // RoleAndMenuPerms 角色和菜单数据权限