接受请求的两个地址分别是:
http://192.168.2.164:8000
https://www.easy-mock.com/mock/5c20714a0fd1077df5e6e944/wwk
例如登录请求地址分别为:
http://192.168.2.164:8000/sys/op/basic/accountLogin
https://www.easy-mock.com/mock/5c20714a0fd1077df5e6e944/wwk/api/auth/login
配置如下:
devServer: {
proxy: {
//本地测试代理
'/api/sys': {
target: 'http://192.168.2.164:8000',
ws: false,
changeOrigin: true,
pathRewrite: {
'^/api/sys': '/api/sys'
}
},
//mock 测试代理
'/api': {
// target: 'https://mock.ihx.me/mock/5baf3052f7da7e07e04a5116/antd-pro',
target: 'https://www.easy-mock.com/mock/5c20714a0fd1077df5e6e944/wwk',
ws: false,
changeOrigin: true,
pathRewrite: {
'^/api': '/api'
}