Pu Zhibing
2025-05-08 afdd96be3f266ee04e7c4a427eb010708e1cace3
ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysPasswordService.java
@@ -53,14 +53,14 @@
        if (retryCount >= Integer.valueOf(maxRetryCount).intValue())
        {
            String errMsg = String.format("密码输入错误%s次,帐户锁定%s分钟", maxRetryCount, lockTime);
            recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL,errMsg);
            recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL,errMsg,Constants.FROM_SYSTEM);
            throw new ServiceException(errMsg);
        }
        if (!matches(user, password))
        {
            retryCount = retryCount + 1;
            recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, String.format("密码输入错误%s次", retryCount));
            recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, String.format("密码输入错误%s次", retryCount),Constants.FROM_SYSTEM);
            redisService.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES);
            throw new ServiceException("用户不存在/密码错误");
        }