From 7a7a8c923f66e96a7e581c71d91a51e83194853b Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sun, 26 May 2024 18:15:41 +0800 Subject: [PATCH] fix --- src/views/reorganize/FileBrowserView.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/views/reorganize/FileBrowserView.vue b/src/views/reorganize/FileBrowserView.vue index ca771508..737de641 100644 --- a/src/views/reorganize/FileBrowserView.vue +++ b/src/views/reorganize/FileBrowserView.vue @@ -38,8 +38,13 @@ const downloadDirectories = ref([]) // 计算公共路径 function findCommonPath(paths: string[]): string { - if (!paths || paths.length === 0) return '' - if (paths.length === 1) return paths[0] + if (!paths || paths.length === 0) return '/' + if (paths.length === 1) { + if (!paths[0].endsWith('/')) { + return paths[0] + '/' + } + return paths[0] + } const normalizedPaths = paths.map(path => path.replace(/\\/g, '/')) const splitPaths = normalizedPaths.map(path => path.split('/')) let commonParts: string[] = []