module.exports = { devServer: { proxy: { //配置跨域 '/apis': { target: 'http://pv.sohu.com', //搜狐的域名 ws: false, changOrigin: true, //允许跨域 pathRewrite: { '^/apis': '' //请求的时候使用这个api就可以 } } } }, }