From e46dc98f580b38aa891924dc2035bf3ee4f76af0 Mon Sep 17 00:00:00 2001 From: aixianling Date: Mon, 23 May 2022 15:03:57 +0800 Subject: [PATCH] =?UTF-8?q?url=E5=8F=82=E6=95=B0=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E7=9A=84=E4=BB=A3=E7=90=86=E6=8C=87=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/router/axios.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/router/axios.js b/examples/router/axios.js index e66fbc61..3de7dde8 100644 --- a/examples/router/axios.js +++ b/examples/router/axios.js @@ -18,6 +18,11 @@ instance.interceptors.request.use(config => { } 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)\//, "") + } } return config }, error => Message.error(error))