1.通过IIS配置 

IIS配置跨域请求

IIS配置跨域请求

2.通过Web.config配置

  <system.webServer>
    <!--跨域请求,允许前端调试-->
    <httpProtocol>
      <customHeaders>
        <add name="Access-Control-Allow-Headers" value="content-type" />
        <add name="Access-Control-Allow-Methods" value="GET,POST,PUT,DELETE,OPTIONS" />
        <add name="Access-Control-Allow-Origin" value="*" />
      </customHeaders>
    </httpProtocol>
  </system.webServer>

 

相关文章:

  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2022-03-08
  • 2022-02-10
  • 2022-12-23
猜你喜欢
  • 2021-06-19
  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-05
  • 2022-01-01
相关资源
相似解决方案