has been blocked by CORS policy: No ‘Access-Control-Allow-Origin‘ header is present on the requested

 A***ess to XMLHttpRequest at 'http://xxx/user/getAll/1/1' from origin 'http://127.0.0.1:8080' has been blocked by CORS policy: No 'A***ess-Control-Allow-Origin' header is present on the requested resource.

网上找到一个方法:

大概就是,chrome安全策略的原因,chrome 禁止跨域策略(CORS policy) 

新建一个 禁止cors跨域相关的策略的 chrome,

1.桌面新建一个快捷方式:

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --disable-gpu --user-data-dir=~/chromeTemp

C:\Program Files (x86)\Google\Chrome\Application\chrome.exe为chrome的路径

2.创建完成,使用该chrome访问即可。

 

转载请说明出处内容投诉
CSS教程_站长资源网 » has been blocked by CORS policy: No ‘Access-Control-Allow-Origin‘ header is present on the requested

发表评论

欢迎 访客 发表评论

一个令你着迷的主题!

查看演示 官网购买