diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index ca05e8d..325915c 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -3425,7 +3425,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', @@ -4058,6 +4058,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}` }, }