diff --git a/packages/ui/src/layouts/shared/files-tab/components/FileContextMenu.vue b/packages/ui/src/layouts/shared/files-tab/components/FileContextMenu.vue index f0b49c09ac..9b5f09b8c1 100644 --- a/packages/ui/src/layouts/shared/files-tab/components/FileContextMenu.vue +++ b/packages/ui/src/layouts/shared/files-tab/components/FileContextMenu.vue @@ -131,7 +131,11 @@ function getFullPath() { if (!currentItem.value) return '' const basePath = ctx.basePath?.value const itemPath = currentItem.value.path - return basePath ? `${basePath}/${itemPath}`.replace(/\/+/g, '/') : itemPath + if (!basePath) return itemPath + const fullPath = `${basePath}/${itemPath}` + return navigator.userAgent.includes('Windows') + ? fullPath.replace(/[\\/]+/g, '\\') + : fullPath.replace(/[\\/]+/g, '/') } function handleCopyPath() { diff --git a/packages/ui/src/layouts/shared/files-tab/components/FileTableRow.vue b/packages/ui/src/layouts/shared/files-tab/components/FileTableRow.vue index 83d82beacc..1dab0ebaeb 100644 --- a/packages/ui/src/layouts/shared/files-tab/components/FileTableRow.vue +++ b/packages/ui/src/layouts/shared/files-tab/components/FileTableRow.vue @@ -197,7 +197,11 @@ const isZip = computed(() => fileExtension.value === 'zip') function getFullPath() { const basePath = ctx.basePath?.value - return basePath ? `${basePath}/${props.path}`.replace(/\/+/g, '/') : props.path + if (!basePath) return props.path + const fullPath = `${basePath}/${props.path}` + return navigator.userAgent.includes('Windows') + ? fullPath.replace(/[\\/]+/g, '\\') + : fullPath.replace(/[\\/]+/g, '/') } const menuOptions = computed(() => {