前端在本地,调试,就经常的就是会遇到 调用接口,提示跨域了。

如你要访问 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   , 前面有空格哈

效果如下图

 

本地调试 谷歌浏览器报错:跨域问题处理  Access-Control-Allow-Origin

 

Tips:  不要把chrome浏览器固定在 桌面最下方的任务栏里  , 至于原因,你固定试下就知道了...

很爽的说

相关文章:

  • 2022-12-23
  • 2021-09-28
  • 2021-09-29
  • 2021-08-14
  • 2022-12-23
  • 2021-11-30
  • 2021-07-27
猜你喜欢
  • 2021-11-30
  • 2021-09-19
  • 2022-01-08
  • 2021-05-22
  • 2021-11-30
  • 2021-12-12
  • 2022-12-23
相关资源
相似解决方案