config.js修改
// proxyTable: {
? ? //? '/api_wj': {
? ? //? ? target: 'http://192.168.1.17:8800', //設(shè)置你調(diào)用的接口域名和端口號(hào) 別忘了加http
? ? //? ? changeOrigin: true,
? ? //? ? pathRewrite: {
? ? //? ? ? '^/api_wj': '/' //這里理解成用‘/api’代替target里面的地址驶悟,后面組件中我們掉接口時(shí)直接用api代替 比如我要調(diào)用'http://40.00.100.100:3002/user/add',直接寫(xiě)‘/api/user/add’即可
? ? //? ? }
? ? //? },
? ? //? '/api_dj': {
? ? //? ? target: 'http://192.168.1.6:80', //設(shè)置你調(diào)用的接口域名和端口號(hào) 別忘了加http
? ? //? ? changeOrigin: true,
? ? //? ? pathRewrite: {
? ? //? ? ? '^/api_dj': '/' //這里理解成用‘/api’代替target里面的地址,后面組件中我們掉接口時(shí)直接用api代替 比如我要調(diào)用'http://40.00.100.100:3002/user/add',直接寫(xiě)‘/api/user/add’即可
? ? //? ? }
? ? //? },
? ? //? '/api_xy': {
? ? //? ? target: 'http://192.168.1.135:80', //設(shè)置你調(diào)用的接口域名和端口號(hào) 別忘了加http
? ? //? ? changeOrigin: true,
? ? //? ? pathRewrite: {
? ? //? ? ? '^/api_xy': '/' //這里理解成用‘/api’代替target里面的地址蚓峦,后面組件中我們掉接口時(shí)直接用api代替 比如我要調(diào)用'http://40.00.100.100:3002/user/add',直接寫(xiě)‘/api/user/add’即可
? ? //? ? }
? ? //? }
? ? // },