king
2021-02-02 316877c1d9e5b6d92334f30b03d97d7e833cd934
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const proxy = require('http-proxy-middleware')
const host = 'http://bms-test.kresstools.cn'
const service = 'oc/'
 
module.exports = function(app) {
  app.use(proxy('/webapi', { 
    target: `${host}/${service}webapi`,
    secure: false,
    changeOrigin: true,
    pathRewrite: {
    '^/webapi': '/'
    }
    // cookieDomainRewrite: "http://localhost:3000"
  }))
  
  app.use(proxy('/zh-CN', { // 登录接口
    target: `${host}/${service}zh-CN`,
    secure: false,
    changeOrigin: true,
    pathRewrite: {
    '^/zh-CN': '/'
    }
  }))
 
  app.use(proxy('/Upload', {
    target: `${host}/${service}zh-CN/Home/Upload`,
    secure: false,
    changeOrigin: true,
    pathRewrite: {
    '^/Upload': '/'
    }
  }))
 
  app.use(proxy('/wxpay', {
    target: `${host}/${service}wxpay`,
    secure: false,
    changeOrigin: true,
    pathRewrite: {
    '^/wxpay': '/'
    }
  }))
 
  app.use(proxy('/Home', { 
    target: `${host}/Home`,
    secure: false,
    changeOrigin: true,
    pathRewrite: {
    '^/Home': '/'
    }
    // cookieDomainRewrite: "http://localhost:3000"
  }))
 
  app.use(proxy('/trans', {
    target: `${host}/${service}trans`,
    secure: false,
    changeOrigin: true,
    pathRewrite: {
    '^/trans': '/'
    }
  }))
}