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