登录增加验证码切换
This commit is contained in:
@@ -51,10 +51,8 @@ public class UserService {
|
|||||||
}
|
}
|
||||||
// 校验 IP:检查客户端 IP 是否在允许范围内
|
// 校验 IP:检查客户端 IP 是否在允许范围内
|
||||||
String allowedIps = user.getAllowedIps();
|
String allowedIps = user.getAllowedIps();
|
||||||
if (allowedIps != null && !allowedIps.isEmpty()) {
|
if (!isIpAllowed(clientIp, allowedIps)) {
|
||||||
if (!isIpAllowed(clientIp, allowedIps)) {
|
throw new RuntimeException("登录IP不在允许范围内");
|
||||||
throw new RuntimeException("登录IP不在允许范围内");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return jwtUtil.generateToken(username, user.getId());
|
return jwtUtil.generateToken(username, user.getId());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user