解决 Vue 项目 invalid host header
module.exports = {
// 跳过检查host
devServer: { disableHostCheck: true }
}
或
module.exports = {
//...
devServer: {
allowedHosts: [
'host.com', // 允许访问的域名地址,即花生壳内网穿透的地址
'.host.com' // .是二级域名的通配符
],
},
};
然后重启即可

浙公网安备 33010602011771号