From efa512ab21abf1f682267a2a597ea00f96d81050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Sat, 30 Nov 2024 09:34:03 +0800 Subject: [PATCH] fix: #580 --- src/common/file.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/common/file.ts b/src/common/file.ts index 4d6aff58..cab8abb0 100644 --- a/src/common/file.ts +++ b/src/common/file.ts @@ -200,17 +200,7 @@ export async function checkUriType(Uri: string) { } // 默认file:// if (uri.startsWith('file:')) { - // 兼容file:/// - // file:///C:/1.jpg - if (uri.startsWith('file:///') && process.platform === 'win32') { - const filePath: string = uri.slice(8); - return { Uri: filePath, Type: FileUriType.Local }; - } - // 处理默认规范 - // file://C:\1.jpg - // file:///test/1.jpg - const filePath: string = uri.slice(7); - + const filePath: string = decodeURIComponent(uri.startsWith('file:///') && process.platform === 'win32' ? uri.slice(8) : uri.slice(7)); return { Uri: filePath, Type: FileUriType.Local }; } if (uri.startsWith('data:')) {