chrome页面起不来:
console里面报错,can not load resource 404.
火狐浏览器报错:
vue页面中报错 [WDS] Disconnected!
原因:
因为用了全局代理软件,
VUE2解决:
所以需要将 config/index.js中
{host:localhost}改为
{host: 127.0.0.1}重启项目即可
vue3解决:
vue.config.js中, 添加 host:‘127.0.0.1’,
devServer: {
disableHostCheck:true,
host:'127.0.0.1',//添加这一行
port: 8888, // 端口号
open: true, // 自动启动浏览器
proxy: {
'/test': {
// target: 'http://gftest.chabaobao.net',
//target: 'http://gf.chabaobao.net',
target: 'http://192.168.1.27:8091',
// target: 'http://192.168.0.103:8091',
// target: 'http://192.168.31.87:8091',
// target: 'http://192.168.31.163:8091',
ws: true,
pathRewrite: {'^/test' : ''}
},
'/production': {
target: 'http://gf.chabaobao.net',
ws: true,
pathRewrite: {'^/production' : ''}
}
}
},