tomcat 跨域的配置
* 允许所有跨域
E:\apache-tomcat-7.0.81\conf\web.xml
<filter> <filter-name>CorsFilter</filter-name> <filter-class>org.apache.catalina.filters.CorsFilter</filter-class> </filter> <filter-mapping> <filter-name>CorsFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
* 跨域 <= 改http response header
Access-Control-Allow-Credentials: true Access-Control-Allow-Origin: http://www.mediamix.cn:8088
Access-Control-Allow-Origin 这个字段对应的值 设定为前端项目部署的url