From 2831c8b5afb12973e6a5475d60507083e284ee6f Mon Sep 17 00:00:00 2001 From: aixianling Date: Tue, 26 Jul 2022 09:34:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/router/axios.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/router/axios.js b/examples/router/axios.js index 5e39299f..3aa1771f 100644 --- a/examples/router/axios.js +++ b/examples/router/axios.js @@ -3,7 +3,7 @@ import {Message} from 'element-ui' let baseURLs = { production: "/", - development: '/saas' + development: '/lan' } instance.defaults.baseURL = baseURLs[process.env.NODE_ENV] instance.interceptors.request.use(config => { @@ -15,15 +15,13 @@ instance.interceptors.request.use(config => { config.baseURL = "/saas" } else if (/\/xiushan/.test(location.pathname)) { config.baseURL = "/xsjr" - config.url = config.url.replace(/(app|auth|admin)\//, "") } else if (/project\/oms/.test(location.pathname)) { config.baseURL = "/omsapi" - config.url = config.url.replace(/(app|auth|admin)\//, "") } else if (/#url-/.test(location.hash)) { config.baseURL = location.hash.replace(/#url-/, '/') - if (["/xsjr", "/omsapi"].includes(config.baseURL)) { - config.url = config.url.replace(/(app|auth|admin)\//, "") - } + } + if (["/xsjr", "/omsapi"].includes(config.baseURL)) { + config.url = config.url.replace(/(app|auth|admin)\//, "") } return config }, error => Message.error(error))