在web网站磁盘中添加文件web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type, api_key, Authorization " />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>