Tomcat跨域

在项目目录下面增加以下配置即可

<filter>
	<filter-name>CorsFilter</filter-name>
	<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
	<init-param>
		<param-name>cors.allowed.origins</param-name>
		<param-value>*</param-value>
	</init-param>
</filter>
<filter-mapping>
	<filter-name>CorsFilter</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
	<welcome-file>index.html</welcome-file>
</welcome-file-list>
鄂ICP备19018033号-1
0.065604s