谷歌浏览器 跨域解决方案

在这里插入图片描述
正常使用谷歌浏览器时,提示接口跨域。

解决跨域方案

1.复制谷歌安装路径
在这里插入图片描述
2.拼接如下代码,注意 --user 前边有一个空格,不要漏掉。

 --user-data-dir="C://Chrome dev session" --disable-web-security --test-type --ignore-certificate-errors

3.完整链接

"C:\Program Files\Google\Chrome\Application\chrome.exe" --user-data-dir="C://Chrome dev session" --disable-web-security --test-type --ignore-certificate-errors

4.在cmd中运行上边的链接
在这里插入图片描述
回车之后 会弹出一个新的谷歌界面,把你的项目在该界面打开就能正常访问接口了。
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_40745143/article/details/131409385
今日推荐