From cb9ade2afd2a367ad767bc605ab7086c695dd010 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 09 十二月 2022 15:53:32 +0800 Subject: [PATCH] 2022-12-09 --- src/setupProxy.js | 36 +++++++++++++++++------------------- 1 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/setupProxy.js b/src/setupProxy.js index 518e445..015f092 100644 --- a/src/setupProxy.js +++ b/src/setupProxy.js @@ -1,9 +1,7 @@ -// const proxy = require('http-proxy-middleware') -// const host = 'http://qingqiumarket.cn' -// const service = 'mkwms/' +const proxy = require('http-proxy-middleware') +const options = require('../public/options.json') -module.exports = function() {} -// module.exports = function(app) { +module.exports = function(app) { // app.use(proxy('/webapi', { // target: `${host}/${service}webapi`, // secure: false, @@ -32,21 +30,21 @@ // } // })) -// app.use(proxy('/wxpay', { -// target: `${host}/${service}wxpay`, -// secure: false, -// changeOrigin: true, -// pathRewrite: { -// '^/wxpay': '/' -// } -// })) + app.use(proxy('/wxpay', { + target: `${options.host}/${options.service}`, + secure: false, + changeOrigin: true + })) // app.use(proxy('/trans', { -// target: `${host}/${service}trans`, +// target: `${host}/${service}`, // secure: false, -// changeOrigin: true, -// pathRewrite: { -// '^/trans': '/' -// } +// changeOrigin: true // })) -// } + +// app.use(proxy('/api', { // 鏃疯闈㈡澘鏈烘帴鍙f祴璇� +// target: `http://192.168.1.66:80`, +// secure: false, +// changeOrigin: true +// })) +} -- Gitblit v1.8.0