接口跨域
需要在请求头加配置
响应头添加
Response.AddHeader("Access-Control-Allow-Origin","*");
或者在web.config 配置
<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" />
</customHeaders>
</httpProtocol>
或者在IIS配置
Access-Control-Allow-Origin 的值最好配置相应的请求方域名,要是*会存在安全问题