1、在web.config文件中的 system.webServer 节点下 增加如下配置
1 <httpProtocol> 2 <customHeaders> 3 <add name="Access-Control-Allow-Origin" value="*" /> 4 <add name="Access-Control-Allow-Headers" value="*" /> 5 <add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE" /> 6 </customHeaders> 7 </httpProtocol>