asp.net跨域问题

web.config中的“system.webServer”标签页中添加

<httpProtocol>
    <customHeaders>
        <add name="Access-Control-Allow-Origin" value="*" />
        <add name="Access-Control-Allow-Methods" value="*" />
        <add name="Access-Control-Allow-Headers" value="*" />
        <add name="Access-Control-Request-Methods" value="*" />
    </customHeaders>
</httpProtocol>

 如果还是不行的话,就找到"<remove name="OPTIONSVerbHandler" />"这句话删除即可

posted on 2020-12-02 16:54  炼金师  阅读(94)  评论(0编辑  收藏  举报

导航