WebApi解决跨域问题

 

 

在web.config里边的system.webServer节点中添加:

<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="*" />
<add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />
</customHeaders>
</httpProtocol>

posted @ 2021-10-28 21:24  垂帘落地  阅读(32)  评论(0编辑  收藏  举报