在网站部署的时候会生成config文件,在里面加入即可
<!--CORS策略阻止 跨域访问问题-->
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="Access-Control-Allow-Origin" value="*" />--*号代表全部,也可以单独给域名
</customHeaders>
</httpProtocol>
</system.webServer>
已被CORS策略阻止:请求的资源上不存在‘Access Control Allow Origin---加入config内容
最新推荐文章于 2024-04-30 17:51:04 发布