mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 15:55:18 +08:00
refactor(session): 注释掉 IP 变化检测逻辑
-移除了对 IP 变化进行检测和处理的代码段 - 保留了对浏览器变化进行检测的逻辑 - 此修改可能旨在调整登录安全策略,减少因 IP 变化导致的用户重新登录情况
This commit is contained in:
@@ -207,15 +207,15 @@ public class SessionService {
|
||||
.getRequest();
|
||||
String currentIp = RequestUtils.getIp(request);
|
||||
String currentUa = RequestUtils.getUa(request);
|
||||
if (!StringUtils.equalsIgnoreCase(currentIp, loginDto.getIp())) {
|
||||
|
||||
// 如果两个ip都不匹配, 则认为是异常登录
|
||||
|
||||
log.warn("检测到IP变化: {} {}", loginDto, currentIp);
|
||||
|
||||
logout(loginDto.getId());
|
||||
throw new BizException("invalidToken", "检测到IP发生变化,请重新登录");
|
||||
}
|
||||
// if (!StringUtils.equalsIgnoreCase(currentIp, loginDto.getIp())) {
|
||||
//
|
||||
// // 如果两个ip都不匹配, 则认为是异常登录
|
||||
//
|
||||
// log.warn("检测到IP变化: {} {}", loginDto, currentIp);
|
||||
//
|
||||
// logout(loginDto.getId());
|
||||
// throw new BizException("invalidToken", "检测到IP发生变化,请重新登录");
|
||||
// }
|
||||
if (!StringUtils.equalsIgnoreCase(currentUa, loginDto.getUa())) {
|
||||
|
||||
log.warn("检测到浏览器变化: {} {}", loginDto, currentUa);
|
||||
|
||||
Reference in New Issue
Block a user