共计 290 个字符,预计需要花费 1 分钟才能阅读完成。
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)
}
}
},
正文完