king
2020-01-03 862b6cf69dc925a6138a7ebf79b782a5d7791202
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const proxy = require('http-proxy-middleware')
const service = 'mkwms'
 
module.exports = function(app) {
  app.use(proxy('/webapi', { 
    target: `http://qingqiumarket.cn/${service}/webapi`,
    secure: false,
    changeOrigin: true,
    pathRewrite: {
    '^/webapi': '/'
    }
    // cookieDomainRewrite: "http://localhost:3000"
  }))
  
  app.use(proxy('/zh-CN', { // 登录接口
    target: `http://qingqiumarket.cn/${service}/zh-CN`,
    secure: false,
    changeOrigin: true,
    pathRewrite: {
    '^/zh-CN': '/'
    }
  }))
 
  app.use(proxy('/Upload', { // 登录接口
    target: `http://qingqiumarket.cn/${service}/zh-CN/Home/Upload`,
    secure: false,
    changeOrigin: true,
    pathRewrite: {
    '^/Upload': '/'
    }
  }))
 
  app.use(proxy('/local', { 
    target: 'http://127.0.0.1:8888',
    secure: false,
    changeOrigin: true,
    pathRewrite: {
    '^/local': '/'
    }
  }))
}