king
2020-01-19 daf42d3c347be272b436f08ff25dfa37f0952852
src/setupProxy.js
@@ -1,8 +1,10 @@
const proxy = require('http-proxy-middleware')
const host = 'http://qingqiumarket.cn'
const service = 'mkwms/'
module.exports = function(app) {
  app.use(proxy('/webapi', { 
    target: 'http://qingqiumarket.cn/MKWMS/webapi',
    target: `${host}/${service}webapi`,
    secure: false,
    changeOrigin: true,
    pathRewrite: {
@@ -12,7 +14,7 @@
  }))
  
  app.use(proxy('/zh-CN', { // 登录接口
    target: 'http://qingqiumarket.cn/MKWMS/zh-CN',
    target: `${host}/${service}zh-CN`,
    secure: false,
    changeOrigin: true,
    pathRewrite: {
@@ -20,6 +22,15 @@
    }
  }))
  app.use(proxy('/Upload', { // 登录接口
    target: `${host}/${service}zh-CN/Home/Upload`,
    secure: false,
    changeOrigin: true,
    pathRewrite: {
    '^/Upload': '/'
    }
  }))
  app.use(proxy('/local', { 
    target: 'http://127.0.0.1:8888',
    secure: false,