proxy: {
"/dev-api/citest/": {
target: "http://127.0.0.1:86/index.php",
logLevel: "debug",
changeOrigin: true,
pathRewrite: { "^/dev-api/citest/": "/" },
onProxyReq: function (proxyReq, req, res, options) {
if (req.body) {
let bodyData = JSON.stringify(req.body);
proxyReq.setHeader("Content-Type", "application/json");
proxyReq.setHeader("Content-Length", Buffer.byteLength(bodyData));
proxyReq.write(bodyData);
}
}
},
vue-cli proxy post json body 一直pending,后台接收不到body数据
最新推荐文章于 2023-07-04 16:03:39 发布