From c8f703ff5887ae6dcdef3e7684f7202744d36d04 Mon Sep 17 00:00:00 2001 From: npmrun <1549469775@qq.com> Date: Wed, 26 Feb 2025 21:40:27 +0800 Subject: [PATCH] =?UTF-8?q?fix-bug:=20=E4=BF=AE=E5=A4=8D=E6=89=93=E5=8C=85?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/utils/index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/utils/index.ts b/src/main/utils/index.ts index d0c3367..f01e550 100644 --- a/src/main/utils/index.ts +++ b/src/main/utils/index.ts @@ -9,7 +9,7 @@ export function getFileUrl(app: string) { } else { winURL = join(__dirname, `../renderer/${app}#/`) } - return winURL + return slash(winURL) } export function isPromise(value: () => any) { @@ -19,3 +19,11 @@ export function isPromise(value: () => any) { export const broadcast = (event: string, ...args: any[]) => { webContents.getAllWebContents().forEach(browser => browser.send(event, ...args)) } + +export function slash(path: string) { + const isExtendedLengthPath = path.startsWith("\\\\?\\") + if (isExtendedLengthPath) { + return path + } + return path.replace(/\\/g, "/") +}