| | |
| | | |
| | | // 判断登录是否锁定 |
| | | int count = getFailCount(tenantId, username); |
| | | int failCount = Func.toInt(ParamCache.getValue(FAIL_COUNT_VALUE), Func.toInt(strategy.getLockingNum())); |
| | | //为防止取值为空报错的情况,当为空的时候给默认只为5次便锁定用户登录,但是一般很难出现这种情况,因为我feign里面是给了默认密码策略查询的 |
| | | int failCountValue = Func.isEmpty(strategy) ? 5:Func.toInt(strategy.getLockingNum()); |
| | | |
| | | int failCount = Func.toInt(ParamCache.getValue(FAIL_COUNT_VALUE), failCountValue); |
| | | |
| | | if (count >= failCount) { |
| | | throw new UserDeniedAuthorizationException(TokenUtil.USER_HAS_TOO_MANY_FAILS); |