proxy: {
'/api': {
target: 'xxxxxxxxxxxxxxxx',
ws: true,
changeOrigin: true,
pathRewrite: {'^/api': '/api'},
cssSourceMap: false,
onProxyReq: function (proxyReq, req, res) {if (proxyReq.getHeader('origin')) {proxyReq.setHeader('origin', 'xxxxxxxxxxxxxxxx')
}
console.log('原门路:' + req.originalUrl, '代理门路:' + req.path)
}
}
},