king
2020-03-22 f0602b981659c6d1ff18e8dba4ca1ce89c5f5610
src/setupProxy.js
@@ -1,9 +1,12 @@
const proxy = require('http-proxy-middleware')
const service = 'mkwms'
const host = 'http://qingqiumarket.cn'
const service = 'mkwms/'
// const host = 'http://cloud.mk9h.cn'
// const service = ''
module.exports = function(app) {
  app.use(proxy('/webapi', { 
    target: `http://qingqiumarket.cn/${service}/webapi`,
    target: `${host}/${service}webapi`,
    secure: false,
    changeOrigin: true,
    pathRewrite: {
@@ -13,7 +16,7 @@
  }))
  
  app.use(proxy('/zh-CN', { // 登录接口
    target: `http://qingqiumarket.cn/${service}/zh-CN`,
    target: `${host}/${service}zh-CN`,
    secure: false,
    changeOrigin: true,
    pathRewrite: {
@@ -21,6 +24,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,