From 39c61e3fba2fe2611410f5b2072663d0ce299407 Mon Sep 17 00:00:00 2001 From: bqy_fe <1743369777@qq.com> Date: Fri, 10 Dec 2021 23:41:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(request.ts):=20baseUrl=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E6=AD=A3=E5=88=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/request.ts b/src/utils/request.ts index 66ea4e3a2..de85a316d 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -110,7 +110,9 @@ export const request = async ( if (permCode && !useUserStore().perms.includes(permCode)) { return $message.error('你没有访问该接口的权限,请联系管理员!'); } - config.url = `${(isMock ? baseMockUrl : baseApiUrl) + config.url}`.replace(/\/{2,}/g, '/'); + const fullUrl = `${(isMock ? baseMockUrl : baseApiUrl) + config.url}`; + config.url = fullUrl.replace(/(?