From b76ac75fb8b3061efb3ffd877ee9e4ae3bc1fdea Mon Sep 17 00:00:00 2001 From: huangchenbj Date: Fri, 13 Dec 2024 11:09:52 +0800 Subject: [PATCH] feat: allow loading file:// protocol microapps --- src/libs/utils.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/utils.ts b/src/libs/utils.ts index d4dc48a9..96f8f962 100644 --- a/src/libs/utils.ts +++ b/src/libs/utils.ts @@ -319,6 +319,9 @@ export function formatAppURL(url: string | null, appName: string | null = null): * BUG FIX: Never using '/' to complete url, refer to https://github.com/jd-opensource/micro-app/issues/1147 */ const fullPath = `${origin}${pathname}${search}` + if (/^file:\/\//.test(fullPath)) { + return fullPath + } return /^https?:\/\//.test(fullPath) ? fullPath : '' } catch (e) { logError(e, appName)