From b0cc9bd3619e69fa4c8bbdedebb56435cfd74a8f Mon Sep 17 00:00:00 2001 From: luodangjia <luodangjia> Date: 星期五, 17 一月 2025 11:24:51 +0800 Subject: [PATCH] 12.18 --- ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysPasswordService.java | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysPasswordService.java b/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysPasswordService.java index 4dfbd86..47783e0 100644 --- a/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysPasswordService.java +++ b/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysPasswordService.java @@ -57,13 +57,13 @@ recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS,errMsg); throw new ServiceException(errMsg); } -// -// if (!matches(user,password)){ -// retryCount = retryCount + 1; -// recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, String.format("密码输入错误%s次", retryCount)); -// redisService.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES); -// throw new ServiceException("密码错误"); -// } + + if (!matches(user,password)){ + retryCount = retryCount + 1; + recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, String.format("密码输入错误%s次", retryCount)); + redisService.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES); + throw new ServiceException("密码错误"); + } // if (!user.getPassword().equals(password)){ // retryCount = retryCount + 1; // recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, String.format("密码输入错误%s次", retryCount)); -- Gitblit v1.7.1