Commit cef23c60a41d00953037888e755fa796fab3568d
1 parent
ffdacc2bd3
Exists in
master
and in
8 other branches
增加配置
Showing 3 changed files with 56 additions and 8 deletions
platform-operate-api/src/main/webapp/WEB-INF/web.xml
View file @
cef23c6
... | ... | @@ -12,6 +12,49 @@ |
12 | 12 | <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
13 | 13 | version="2.5" |
14 | 14 | xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> |
15 | + | |
16 | + | |
17 | +<filter> | |
18 | + <filter-name>CorsFilter</filter-name> | |
19 | + <filter-class>org.apache.catalina.filters.CorsFilter</filter-class> | |
20 | + <init-param> | |
21 | + <param-name>cors.allowed.origins</param-name> | |
22 | + <param-value>*</param-value> | |
23 | + </init-param> | |
24 | + <init-param> | |
25 | + <param-name>cors.allowed.methods</param-name> | |
26 | + <param-value>GET,POST,HEAD,OPTIONS,PUT,DELETE</param-value> | |
27 | + </init-param> | |
28 | + <init-param> | |
29 | + <param-name>cors.allowed.headers</param-name> | |
30 | + <param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,authorization</param-value> | |
31 | + </init-param> | |
32 | + <init-param> | |
33 | + <param-name>cors.exposed.headers</param-name> | |
34 | + <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value> | |
35 | + </init-param> | |
36 | + <init-param> | |
37 | + <param-name>cors.support.credentials</param-name> | |
38 | + <param-value>true</param-value> | |
39 | + </init-param> | |
40 | + <init-param> | |
41 | + <param-name>cors.preflight.maxage</param-name> | |
42 | + <param-value>10</param-value> | |
43 | + </init-param> | |
44 | +</filter> | |
45 | +<filter-mapping> | |
46 | + <filter-name>CorsFilter</filter-name> | |
47 | + <url-pattern>/*</url-pattern> | |
48 | +</filter-mapping> | |
49 | + | |
50 | + | |
51 | +<servlet-mapping> | |
52 | + <servlet-name>default</servlet-name> | |
53 | + <url-pattern>*.xml</url-pattern> | |
54 | + </servlet-mapping> | |
55 | + | |
56 | + | |
57 | + | |
15 | 58 | <context-param> |
16 | 59 | <param-name>contextConfigLocation</param-name> |
17 | 60 | <param-value> |
... | ... | @@ -25,10 +68,6 @@ |
25 | 68 | <context-param> |
26 | 69 | <param-name>log4jConfigLocation</param-name> |
27 | 70 | <param-value>classpath:log4j_config.xml</param-value> |
28 | - </context-param> | |
29 | - <context-param> | |
30 | - <param-name>webAppRootKey</param-name> | |
31 | - <param-value>webapp.operate</param-value> | |
32 | 71 | </context-param> |
33 | 72 | <context-param> |
34 | 73 | <param-name>log4jRefreshInterval</param-name> |
platform-operate-api/src/main/webapp/clientaccesspolicy.xml
View file @
cef23c6
1 | +<?xml version="1.0" encoding="utf-8" ?> | |
2 | + <access-policy> | |
3 | + <cross-domain-access> | |
4 | + <policy> | |
5 | + <allow-from http-request-headers="*"> | |
6 | + <domain uri="*"/> | |
7 | + </allow-from> | |
8 | + <grant-to> | |
9 | + <resource path="/" include-subpaths="true"/> | |
10 | + </grant-to> | |
11 | + </policy> | |
12 | + </cross-domain-access> | |
13 | + </access-policy> |
platform-operate-api/src/main/webapp/crossdomain.xml
View file @
cef23c6