![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
浏览器同源
沙子揉碎在眼睛里
你必须狠努力,才能看起来毫不费力
展开
-
Uncaught (in promise) DOMException: Failed to execute 'open' on 'XMLHttpRequest': Invalid URL
解决方案:在请求的url加上‘http://’原创 2019-12-02 10:35:15 · 1047 阅读 · 1 评论 -
No Access-Control-Allow-Origin header is present on the requested resource
关于跨域问题解决方案:1、后台添加设置:response.setHeader("Access-Control-Allow-Origin", "*");2、nginx代理配置项加上允许跨域: add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Credentials 'true'; ...原创 2019-11-27 16:58:38 · 1181 阅读 · 0 评论 -
Access to XMLHttpRequest at 'http://localhost:8080/api/login' from origin 'http://localhost:8080'
解决方案:1.在被请求的php文件中加入请求头部header('Access-Control-Allow-Origin: *');<?php header('Access-Control-Allow-Origin: *'); $arr = [ array('id'=>1,'title'=>'one') ]; echo json_encod...原创 2019-12-02 10:30:51 · 44024 阅读 · 3 评论