springmvc配置文件中添加如下内容:
<!--cors跨域支持-->
<mvc:cors>
<mvc:mapping path="/**"
allowed-origins="http://localhost:8081"
allowed-methods="GET,POST,PUT,DELETE,OPTIONS"
allowed-headers="Content-Type,token"
allow-credentials="true"
max-age="123" />
</mvc:cors>
网友评论