he2802 пре 1 година
родитељ
комит
5102ee6e81

+ 5 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserLoginErrorServiceImpl.java

@@ -107,14 +107,16 @@ public class UserLoginErrorServiceImpl extends ServiceImpl<UserLoginErrorMapper,
         lqwExam.eq(UserLoginError::getLoginAccount, loginAccount);
         lqwExam.eq(UserLoginError::getDate, DateUtils.getTodayZeroTime());
         Integer count = baseMapper.selectCount(lqwExam);
-        String jsonStr = configService.selectConfigByKey("client.config");
+        String jsonStr = configService.selectConfigByKeyNoCache("client.config");
         if(Validator.isNotEmpty(jsonStr)){
             JSONObject objectJson = JSON.parseObject(jsonStr);
             if(Validator.isNotEmpty(objectJson)&&objectJson.containsKey("other")){
                 JSONObject jsonObject = objectJson.getJSONObject("other");
                 Integer maxCount = jsonObject.getInteger("loginLimit");
-                if(maxCount>0&&count>=maxCount){
-                    throw new CustomException("今天你的错误次数已超过"+maxCount+"次,请明天再登录");
+                if(Validator.isNotEmpty(maxCount)){
+                    if(maxCount>0&&count>=maxCount){
+                        throw new CustomException("今天你的错误次数已超过"+maxCount+"次,请明天再登录");
+                    }
                 }
             }
         }