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(/(?