|
@@ -27,10 +27,10 @@ public class RestCorsFilter implements Filter {
|
27
|
27
|
// 允许的来源
|
28
|
28
|
String[] allowDomain = {
|
29
|
29
|
"http://10.152.70.21:8080", // CAS服务器
|
30
|
|
- "http://10.152.72.7:8181" ,// 岗检前端Nginx
|
|
30
|
+ "http://10.152.72.7:8181" // 岗检前端Nginx
|
31
|
31
|
// "*.cnooc.*"
|
32
|
32
|
// TODO 打包屏蔽-甲方部署时注释:甲方不需要本地登录功能采用单点登录
|
33
|
|
- "http://192.168.3.32:81" // 前端开发
|
|
33
|
+// ,"http://192.168.3.32:81" // 前端开发
|
34
|
34
|
};
|
35
|
35
|
Set<String> allowedOrigins = new HashSet<>(Arrays.asList(allowDomain));
|
36
|
36
|
String originHeader = request.getHeader("Origin");
|
|
@@ -40,17 +40,13 @@ public class RestCorsFilter implements Filter {
|
40
|
40
|
response.setHeader("Access-Control-Allow-Credentials", "true");
|
41
|
41
|
response.setHeader("Access-Control-Allow-Methods", "POST, GET, DELETE, PUT");
|
42
|
42
|
response.setHeader("Access-Control-Max-Age", "31536000");
|
43
|
|
- response.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, X-Requested-With");
|
|
43
|
+ response.setHeader("Access-Control-Allow-Headers", "*");
|
|
44
|
+ response.setStatus(HttpServletResponse.SC_OK);
|
44
|
45
|
} else {
|
45
|
46
|
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
|
46
|
47
|
return;
|
47
|
48
|
}
|
48
|
|
-
|
49
|
|
- if ("OPTIONS".equalsIgnoreCase(request.getMethod())) {
|
50
|
|
- response.setStatus(HttpServletResponse.SC_OK);
|
51
|
|
- } else {
|
52
|
49
|
chain.doFilter(req, res);
|
53
|
|
- }
|
54
|
50
|
}
|
55
|
51
|
|
56
|
52
|
@Override
|