|
@@ -39,6 +39,16 @@ module.exports = {
|
|
changeOrigin: true,
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
pathRewrite: {
|
|
['^' + process.env.VUE_APP_BASE_API]: ''
|
|
['^' + process.env.VUE_APP_BASE_API]: ''
|
|
|
|
+ },
|
|
|
|
+ onProxyReq: function(proxyReq, req, res, options) {
|
|
|
|
+ if(req.body) {
|
|
|
|
+ const reg = new RegExp('application/json')
|
|
|
|
+ if(reg.test(proxyReq.getHeader('Content-Type'))) {
|
|
|
|
+ const bodyData = JSON.stringify(req.body)
|
|
|
|
+ proxyReq.setHeader('Content-Length', Buffer.byteLength(bodyData))
|
|
|
|
+ proxyReq.write(bodyData)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|