Cors解决跨域问题之mvc配置过滤

只需要在mvc的过滤器配置位置进行以下的配置即可

<mvc:cors>

 
<mvc:mapping path="/api/**"

allowed-origins="http://twgfs.cn, http://twgfs.online"

allowed-methods="GET, PUT,POST"

allowed-headers="header1, header2, header3"

exposed-headers="header1, header2" allow-credentials="true"

max-age="1024" />

 
<mvc:mapping path="/resources/**"

allowed-origins="http://twgfs.cn" />
发布了19 篇原创文章 · 获赞 7 · 访问量 6623

猜你喜欢

转载自blog.csdn.net/William_TWG/article/details/104976180
今日推荐