Pu Zhibing
2025-04-01 8444084e6aa11efa23287e7f82474ac22378a5c4
ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysPasswordService.java
@@ -8,12 +8,12 @@
import com.ruoyi.common.core.exception.ServiceException;
import com.ruoyi.common.redis.service.RedisService;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.domain.poji.sys.SysUser;
/**
 * 登录密码方法
 * 
 * @author ruoyi
 * @author jqs
 */
@Component
public class SysPasswordService
@@ -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("用户不存在/密码错误");
        }