king
2025-05-23 24842b40de5cd60700bf69dfd38a0332f5431e36
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', { // 旷视面板机接口测试
//     target: `http://192.168.1.66:80`,
//     secure: false,
//     changeOrigin: true
//   }))
}