From 4b21a3bc48963ef6e85de832ca05f7b6ee40f6dc Mon Sep 17 00:00:00 2001
From: wangfeiyu <wangfeiyu@cscec.com>
Date: Wed, 22 Feb 2023 08:54:10 +0800
Subject: [PATCH] 在方法isMatchedIp的参数中,当filter为null而ip非null/空时,报filter为null异常。把判断条件由&&改为||解决此bug。

---
 ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysPasswordService.java |    6 +++---
 1 files changed, 3 insertions(+), 3 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 06e111a..eb18ea8 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
@@ -21,9 +21,9 @@
     @Autowired
     private RedisService redisService;
 
-    private int maxRetryCount = CacheConstants.passwordMaxRetryCount;
+    private int maxRetryCount = CacheConstants.PASSWORD_MAX_RETRY_COUNT;
 
-    private Long lockTime = CacheConstants.passwordLockTime;
+    private Long lockTime = CacheConstants.PASSWORD_LOCK_TIME;
 
     @Autowired
     private SysRecordLogService recordLogService;
@@ -60,7 +60,7 @@
         if (!matches(user, password))
         {
             retryCount = retryCount + 1;
-            recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, String.format("密码输入错误%s次", maxRetryCount));
+            recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, String.format("密码输入错误%s次", retryCount));
             redisService.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES);
             throw new ServiceException("用户不存在/密码错误");
         }

--
Gitblit v1.9.3