refactor: checkLogin登录失败定位到ip

This commit is contained in:
zccbbg 2024-08-30 11:31:39 +08:00
parent 6f60dc1859
commit 30276a2ec0

View file

@ -307,7 +307,8 @@ public class SysLoginService {
* 登录校验
*/
private void checkLogin(LoginType loginType, String username, Supplier<Boolean> supplier) {
String errorKey = CacheConstants.PWD_ERR_CNT_KEY + username;
String clientIP = ServletUtils.getClientIP();
String errorKey = CacheConstants.PWD_ERR_CNT_KEY + username+":"+clientIP;
String loginFail = Constants.LOGIN_FAIL;
// 获取用户登录错误次数默认为0 (可自定义限制策略 例如: key + username + ip)