uniapp项目运行到浏览器报错:Access to XMLHttpRequest at ‘http://xxx’ from origin ‘http://localhost:8080’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
--disable-web-security --user-data-dir=C:\chromedata
复制个谷歌的快捷键,右键谷歌图标,在目标后加上上面的代码,即从浏览器端解决跨域问题
原:
解决跨域问题: