首页 > 代码库 > 本地调试 谷歌浏览器报错:跨域问题处理 Access-Control-Allow-Origin
本地调试 谷歌浏览器报错:跨域问题处理 Access-Control-Allow-Origin
前端在本地,调试,就经常的就是会遇到 调用接口,提示跨域了。
如你要访问 http://****/api/user
chrome 浏览器 报错:
XMLHttpRequest cannot load http://****/api/user No ‘Access-Control-Allow-Origin‘ header is present on the requested resource. Origin ‘null‘ is therefore not allowed access.
在谷歌中实现数据跨域,其实,处理下很简单,在属性中加入一个值 --disable-web-security --user-data-dir , 前面有空格哈
效果如下图
Tips: 不要把chrome浏览器固定在 桌面最下方的任务栏里 , 至于原因,你固定试下就知道了...
很爽的说
本地调试 谷歌浏览器报错:跨域问题处理 Access-Control-Allow-Origin
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。