zl程序教程

您现在的位置是:首页 >  前端

当前栏目

谷歌浏览器跨域设置都是127.0.0.1出现跨域

浏览器跨域谷歌 设置 出现 0.1 127.0
2023-09-11 14:16:34 时间

XMLHttpRequest cannot load http://127.0.0.1:8080/ptmo/services/ptmo/v1/execOneSql. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8020' is therefore not allowed access.

 

(1)在电脑上新建一个目录,例如:C:\MyChromeDevUserData

(2)在属性页面中的目标输入框里加上: --disable-web-security --user-data-dir=C:\MyChromeDevUserData

 

(3)点击应用和确定后关闭属性页面,并打开 chrome 浏览器。发现有“--disable-web-security”相关的提示,说明 chrome 已经可以正常跨域工作了。