我封装了axios,因为现在是本地开发,所以跨域了,需要配置proxyTable:
proxyTable: {
'/api': {
target: 'http://localhost:80',
// secure: false, // 如果是https接口,需要配置这个参数
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
},
但是封装axios这边还要写axios.defaults.baseURL = 'http://localhost:80'吗?,这两边的配置分别有什么区别?求教,谢谢!