如何实现线上环境使用setting.host + '/api/sop/',本地dev请求localhost:3000呢?
const instance = axios.create({
baseURL: setting.host + '/api/sop/',
timeout: 20000,
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
},
});
config
proxyTable: { '/api': { target: "http://127.0.0.1:3000", changeOrigin: true, pathRewrite: { '^/api': "" } } },
拉风的咖菲猫
相关分类