diff --git a/examples/router/axios.js b/examples/router/axios.js index 3aa1771f..bfbb24a9 100644 --- a/examples/router/axios.js +++ b/examples/router/axios.js @@ -13,6 +13,8 @@ instance.interceptors.request.use(config => { config.baseURL = "/wg" } else if (/\/project\/sass/.test(location.pathname)) { config.baseURL = "/saas" + } else if (/\/tianfuxing/.test(location.pathname)) { + config.baseURL = "/tfx" } else if (/\/xiushan/.test(location.pathname)) { config.baseURL = "/xsjr" } else if (/project\/oms/.test(location.pathname)) { @@ -20,7 +22,7 @@ instance.interceptors.request.use(config => { } else if (/#url-/.test(location.hash)) { config.baseURL = location.hash.replace(/#url-/, '/') } - if (["/xsjr", "/omsapi"].includes(config.baseURL)) { + if (["/xsjr", "/omsapi", "/tfx"].includes(config.baseURL)) { config.url = config.url.replace(/(app|auth|admin)\//, "") } return config diff --git a/vue.config.js b/vue.config.js index d7f9c672..0abff547 100644 --- a/vue.config.js +++ b/vue.config.js @@ -119,6 +119,14 @@ module.exports = { //地址重写 '^/wg': '/' } + }, + '/tfx': { + target: 'http://192.168.1.87:12421', + changeOrigin: true, + pathRewrite: { + //地址重写 + '^/tfx': '/api' + } } }, disableHostCheck: true