当在使用electron-vue中使用axios进行请求的时候游览器直接报错
报错内容如下:
Failed to load
https://weread.qq.com/web/search/global?keyword=&maxIdx=0&fragmentSize=120&count=20:
No ‘Access-Control-Allow-Origin’ header is present on the requested
resource. Origin ‘http://localhost:9080’ is therefore not allowed
access.
这里只需要在src/main/index.js中的BrowserWindow中添加上以下内容即可
webPreferences:{
webSecurity:false
}