WebForm 配置跨域

在 web.config 里 configuration 节点下加上以下配置:

<system.webServer>
    <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>
  </system.webServer>

image

posted @ 2024-11-14 22:00  灵火  阅读(3)  评论(0编辑  收藏  举报