代理assist 跨域
parent
cb461df619
commit
15fd6c920e
|
@ -18,6 +18,7 @@ import org.springframework.util.ObjectUtils;
|
||||||
|
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.ConnectException;
|
import java.net.ConnectException;
|
||||||
|
|
||||||
|
@ -181,6 +182,18 @@ public class ProxyServletConfig {
|
||||||
return queryStr;
|
return queryStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected HttpResponse doExecute(HttpServletRequest servletRequest, HttpServletResponse servletResponse,
|
||||||
|
HttpRequest proxyRequest) throws IOException {
|
||||||
|
HttpResponse response = super.doExecute(servletRequest, servletResponse, proxyRequest);
|
||||||
|
String origin = servletRequest.getHeader("origin");
|
||||||
|
response.setHeader("Access-Control-Allow-Origin",origin);
|
||||||
|
response.setHeader("Access-Control-Allow-Credentials","true");
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异常处理
|
* 异常处理
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -111,6 +111,7 @@ user-settings:
|
||||||
- http://localhost:9091
|
- http://localhost:9091
|
||||||
- http://127.0.0.1:9091
|
- http://127.0.0.1:9091
|
||||||
- http://172.19.128.50:9091
|
- http://172.19.128.50:9091
|
||||||
|
- http://172.19.128.50:8080
|
||||||
# [可选] 日志配置, 一般不需要改
|
# [可选] 日志配置, 一般不需要改
|
||||||
logging:
|
logging:
|
||||||
config: classpath:logback-spring-local.xml
|
config: classpath:logback-spring-local.xml
|
||||||
|
|
Loading…
Reference in New Issue