From ba615a915ce621f3dc2981397069a9081af61c76 Mon Sep 17 00:00:00 2001 From: jmal Date: Fri, 24 May 2024 16:56:34 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=B7=BB=E5=8A=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9=E5=8F=B3=E9=94=AE=E2=80=9C=E5=A4=8D=E5=88=B6=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E9=93=BE=E6=8E=A5=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ShowFile/ShowFile.vue | 6 +++++- src/utils/file-config.js | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 2760cf0..b945e23 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -3424,7 +3424,7 @@ export default { this.menus.splice(index, 1) } } - if (row.isShare && !row.isPrivacy && !row.isFolder) { + if (row.isShare && !row.isPrivacy) { // 添加复制下载链接选项 this.menus.splice(-2, 0, { iconClass: 'menu-fuzhi', @@ -4049,6 +4049,10 @@ export default { undefined, undefined ) + if (row.isFolder) { + url = fileConfig.packageDownloadUrl(row.id, row.name + '.zip') + } + console.log('url', url) let clipboard = new Clipboard('.newFileMenu', { text: function() { return url diff --git a/src/utils/file-config.js b/src/utils/file-config.js index 273d6f3..ea22b57 100644 --- a/src/utils/file-config.js +++ b/src/utils/file-config.js @@ -98,6 +98,12 @@ export default { }, // 共享文件打包下载Url publicPackageDownloadUrl: function(shareId, fileIds, shareToken) { - return window.location.origin + `${this.baseUrl}/public/s/packageDownload?shareId=${shareId}&fileIds=${fileIds}&share-token=${shareToken}` + const queryShareId = shareId ? `&shareId=${shareId}` : '' + const queryShareToken = shareToken ? `&share-token=${shareToken}` : '' + return window.location.origin + `${this.baseUrl}/public/s/packageDownload?fileIds=${fileIds}${queryShareId}${queryShareToken}` + }, + // 文件打包下载Url + packageDownloadUrl: function(fileId, downloadName) { + return window.location.origin + `${this.baseUrl}/public/s/${fileId}/packageDownload/${downloadName}` }, }