fix(upms): 修复用户登录失败次数缓存清理问题

- 在用户登录成功时清理对应的登录失败次数缓存
- 使用RedisUtils删除格式化的缓存key
- 防止因缓存残留导致用户被错误锁定
This commit is contained in:
PIGCLOUD committed 2025-11-18 09:39:05 +08:00
1 parent a25963323b
commit 6de57dfab1
1 file changed
+5
@@ -347,6 +347,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
});
}
// 同时清理用户失败次数的缓存
String key = String.format("%s%s:%s", CacheConstants.GLOBALLY
, CacheConstants.LOGIN_ERROR_TIMES, userDto.getUsername());
RedisUtils.delete(key);
return Boolean.TRUE;
}