|
@ -69,7 +69,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { |
|
|
@Override |
|
|
@Override |
|
|
public boolean matches(HttpServletRequest request) { |
|
|
public boolean matches(HttpServletRequest request) { |
|
|
// 获取请求的IP
|
|
|
// 获取请求的IP
|
|
|
String requestIP = request.getRemoteAddr(); |
|
|
String requestIP = request.getHeader("X-Forwarded-For"); |
|
|
// 将配置文件中的IP字符串分割为数组
|
|
|
// 将配置文件中的IP字符串分割为数组
|
|
|
String[] ips = allowedIPs.split(","); |
|
|
String[] ips = allowedIPs.split(","); |
|
|
// 检查请求的IP是否在允许的IP数组中
|
|
|
// 检查请求的IP是否在允许的IP数组中
|
|
|