| | |
| | | redisUtil.set(CommonConstant.PREFIX_LOGIN_COUNT + username, 1, 300); |
| | | result.error500("用户名或密码错误,请重新尝试。剩余尝试次数:" + (maxAttempts - 1)); |
| | | } |
| | | } else { |
| | | result.error500("用户名或密码错误"); |
| | | } |
| | | |
| | | |
| | | //result.error500("用户名或密码错误"); |
| | | return result; |
| | | } else { |
| | | if (redisUtil.hasKey(CommonConstant.PREFIX_LOGIN_COUNT + username)) { |
| | | redisUtil.del(CommonConstant.PREFIX_LOGIN_COUNT + username); |
| | | List<DictModel> dictModels = sysDictService.queryEnableDictItemsByCode(CommonConstant.DICT_MAX_ATTEMPTS); |
| | | if (dictModels != null && !dictModels.isEmpty()) { |
| | | Integer maxAttempts = Integer.valueOf(dictModels.get(0).getValue()); |
| | | Integer loginCount = (Integer) redisUtil.get(CommonConstant.PREFIX_LOGIN_COUNT + username); |
| | | if (loginCount < maxAttempts) { |
| | | redisUtil.del(CommonConstant.PREFIX_LOGIN_COUNT + username); |
| | | } else { |
| | | result.error500("您的账户已锁定,请稍后尝试!"); |
| | | return result; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |