.net Fremework跨域设置

 

webconfig文件增加如下配置:

<customHeaders>
<add name="Access-Control-Allow-Headers" value="TCookie,Origin,X-Requested-With,Authorization,Content-Type" />
<!--已做动态Origin处理,不要设置这个属性。详见AppConfig-->
<!--<add name="Access-Control-Allow-Origin" value="*" />-->
<!--<add name="Access-Control-Allow-Origin" value="http://test-local.www.com,http://debug.wwwww.com:8094,http://localhost:8080" />-->
<add name="Access-Control-Allow-Credentials" value="true" />
<add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />
</customHeaders>

posted @ 2024-11-08 14:06  zengxia  阅读(1)  评论(0编辑  收藏  举报