diff --git a/src/components/Icon/Icon.vue b/src/components/Icon/Icon.vue index 1d51394..4ea8b87 100644 --- a/src/components/Icon/Icon.vue +++ b/src/components/Icon/Icon.vue @@ -5,7 +5,7 @@ import { Icon } from 'ant-design-vue' const IconFont = Icon.createFromIconfontCN({ - scriptUrl: '//at.alicdn.com/t/font_2024484_dczwxweaavk.js' + scriptUrl: '//at.alicdn.com/t/font_2024484_q3oifn59jr.js' }) // 把此段代码贴到iconfont项目页面的控制台中, 以获取图标列表 @@ -16,7 +16,7 @@ const IconFont = Icon.createFromIconfontCN({ // console.log(iconNames.slice(80,160)) export const iconFonts = { - list: ["iso", "zuijinhuoyue","key", "shouquan", "sort", "grid", "list", "emoji-a", "emoji-bizui", "emoji-baiyan", "emoji-aixin", "emoji-dajing", "emoji-ziya", "emoji-daxiao", "emoji-esi", "emoji-fadai", "emoji-fankun", "emoji-ganga", "emoji-fennu", "emoji-hanyan", "emoji-jingkong", "emoji-haochi", "emoji-emo", "emoji-jingsong", "emoji-jingya", "emoji-kaixin", "emoji-lengku", "emoji-danao", "emoji-liukoushui", "emoji-liulei", "emoji-mengbi", "mianwubiaoqing", "nanguo", "shuizhuo", "taoyan", "tanchi", "siliao", "tiaopi", "xiaochulei", "wuliao", "xingxingyan", "xieyan", "xiasi", "xiaolian", "ku", "shengqi", "yousiliao", "en", "bushufu", "bianbian", "fankun1", "feiwen", "ganmao", "huaixiao", "liuhan", "outu", "keshui", "renzhe", "santiaoxian", "guaiwu", "shoushang", "tianshi", "shuai", "xianwen", "xiaodiaodaya", "xiong", "yiwen", "yun", "liubixie", "shimo", "dianzan", "biti", "fendou", "huqi", "heng", "kulou", "leng", "taoyan1", "shuixing", "aini", "aixin1", "zhadan", "xinsui", + list: ["menu-fuzhi", "iso", "zuijinhuoyue","key", "shouquan", "sort", "grid", "list", "emoji-a", "emoji-bizui", "emoji-baiyan", "emoji-aixin", "emoji-dajing", "emoji-ziya", "emoji-daxiao", "emoji-esi", "emoji-fadai", "emoji-fankun", "emoji-ganga", "emoji-fennu", "emoji-hanyan", "emoji-jingkong", "emoji-haochi", "emoji-emo", "emoji-jingsong", "emoji-jingya", "emoji-kaixin", "emoji-lengku", "emoji-danao", "emoji-liukoushui", "emoji-liulei", "emoji-mengbi", "mianwubiaoqing", "nanguo", "shuizhuo", "taoyan", "tanchi", "siliao", "tiaopi", "xiaochulei", "wuliao", "xingxingyan", "xieyan", "xiasi", "xiaolian", "ku", "shengqi", "yousiliao", "en", "bushufu", "bianbian", "fankun1", "feiwen", "ganmao", "huaixiao", "liuhan", "outu", "keshui", "renzhe", "santiaoxian", "guaiwu", "shoushang", "tianshi", "shuai", "xianwen", "xiaodiaodaya", "xiong", "yiwen", "yun", "liubixie", "shimo", "dianzan", "biti", "fendou", "huqi", "heng", "kulou", "leng", "taoyan1", "shuixing", "aini", "aixin1", "zhadan", "xinsui", "maren", "zhutou", "qie", "youling", "apple-fill", "attachment", "android-fill", "apple", "download", "arrow-up-circle", "arrow-right-circle", "arrow-down", "ashbin", "add", "file_music", "menu", "role", "jiaoseguanli", "yemianshezhi", "drop_down", "yuandian", "tag", "service-directory", "fabu", "wailian", "bianji-", "WEBSITE", "wangzhanguanli", "Up", "up", "fenlei", "guanlizhuanjiawenzhang", "pifu", "tuichudenglu", "shezhi", "wangzhan", "huaban", "yunshezhi", "UserSettings", "blogger", "biaoqian", "myself", "guidang", "quxiaoyulan1-copy", "yulan-copy", "quxiaoyulan1", "yulan"] } diff --git a/src/components/button/CopyButton.vue b/src/components/button/CopyButton.vue new file mode 100644 index 0000000..4c1f9d9 --- /dev/null +++ b/src/components/button/CopyButton.vue @@ -0,0 +1,15 @@ + + + + + diff --git a/src/utils/file-config.js b/src/utils/file-config.js index b1a807a..58c1d6c 100644 --- a/src/utils/file-config.js +++ b/src/utils/file-config.js @@ -28,8 +28,7 @@ export default { }) }, publicDownload: function(shareId, file) { - let url = `${this.baseUrl}/public/s/download/${file.id}/${shareId}` - window.open(url, '_self') + window.open(this.publicDownloadUrl(shareId, file), '_self') }, packageDownload: function(fileIds, token) { fileApi.isAllowDownload().then(() => { @@ -37,6 +36,12 @@ export default { }) }, publicPackageDownload: function(shareId, fileIds) { - window.open(`${this.baseUrl}/public/s/packageDownload?shareId=${shareId}&fileIds=${fileIds}`, '_self') + window.open(this.publicPackageDownloadUrl(shareId, fileIds), '_self') + }, + publicDownloadUrl: function(shareId, file) { + return window.location.origin + `${this.baseUrl}/public/s/download/${file.id}/${shareId}` + }, + publicPackageDownloadUrl: function(shareId, fileIds) { + return window.location.origin + `${this.baseUrl}/public/s/packageDownload?shareId=${shareId}&fileIds=${fileIds}` }, } diff --git a/src/views/public/article/ArticleTop.vue b/src/views/public/article/ArticleTop.vue deleted file mode 100644 index fa530e9..0000000 --- a/src/views/public/article/ArticleTop.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - diff --git a/src/views/public/article/SidebarNav.vue b/src/views/public/article/SidebarNav.vue deleted file mode 100644 index 9297f1c..0000000 --- a/src/views/public/article/SidebarNav.vue +++ /dev/null @@ -1,95 +0,0 @@ - - - diff --git a/src/views/public/article/index.vue b/src/views/public/article/index.vue deleted file mode 100644 index 0b439f7..0000000 --- a/src/views/public/article/index.vue +++ /dev/null @@ -1,295 +0,0 @@ - - - - diff --git a/src/views/public/articles/index.vue b/src/views/public/articles/index.vue deleted file mode 100644 index efbe9c7..0000000 --- a/src/views/public/articles/index.vue +++ /dev/null @@ -1,219 +0,0 @@ - - - - diff --git a/src/views/public/share/shareList.vue b/src/views/public/share/shareList.vue index 65e5778..422ad53 100644 --- a/src/views/public/share/shareList.vue +++ b/src/views/public/share/shareList.vue @@ -3,6 +3,7 @@ +
@@ -38,21 +39,10 @@
    -
  • +
  • -
  • - -
  • -
@@ -258,7 +248,7 @@ import VideoPreview from "@/components/preview/VideoPreview"; import AudioPreview from "@/components/preview/AudioPreview"; import fileConfig from "@/utils/file-config"; - + import Clipboard from "clipboard"; export default { components: { IconFile, BreadcrumbFilePath,AlLoading, AudioPreview, VideoPreview, ImageViewer, SimTextPreview @@ -317,10 +307,12 @@ singleMenus: [ { iconClass: 'menu-open', label: '打开', operation: 'open' }, { iconClass: 'menu-download', label: '下载', operation: 'download' }, + { iconClass: 'menu-fuzhi', label: '复制下载连接', operation: 'copyDownloadUrl' }, ], singleMenusEdit: [ { iconClass: 'menu-open', label: '打开', operation: 'open' }, { iconClass: 'menu-download', label: '下载', operation: 'download' }, + { iconClass: 'menu-fuzhi', label: '复制下载连接', operation: 'copyDownloadUrl' }, ], multipleMenus: [ { iconClass: 'menu-download', label: '下载', operation: 'download' }, @@ -840,10 +832,13 @@ case 'download': this.downloadFile() break + case 'copyDownloadUrl': + this.downloadFile(true) + break } this.$refs.contextShow.hideMenu() }, - downloadFile() { + downloadFile(copy) { let totalSize = 0 if(this.indexList.length > 0){ this.selectRowData.forEach(item => { @@ -862,10 +857,18 @@ fileIds.push(this.rowContextData.id) } if (fileIds.length > 1 || this.rowContextData.isFolder){ - fileConfig.publicPackageDownload(this.shareId, fileIds, this.$store.state.user.token) + if(copy){ + this.copyDownloadLink(fileConfig.publicPackageDownloadUrl(this.shareId, fileIds)) + } else { + fileConfig.publicPackageDownload(this.shareId, fileIds) + } return } - fileConfig.publicDownload( this.shareId, this.rowContextData) + if(copy){ + this.copyDownloadLink(fileConfig.publicDownloadUrl( this.shareId, this.rowContextData)) + } else { + fileConfig.publicDownload( this.shareId, this.rowContextData) + } } else { this.$message({ message: '所选文件为空', @@ -873,6 +876,24 @@ }); } }, + // 复制下载连接 + copyDownloadLink(url) { + let clipboard = new Clipboard('.menu-option', { + text: function (){ + return url + } + }) + clipboard.on('success', e => { + this.$message({message: '复制成功',type: 'success',duration: 1000}); + // 释放内存 + clipboard.destroy() + }) + clipboard.on('error', e => { + // 不支持复制 + this.$message({message: '该浏览器不支持自动复制',type: 'warning',duration: 1000}); + clipboard.destroy() + }) + }, // 点击文件或文件夹 fileClick(row) { if (row.isFolder) { @@ -985,5 +1006,8 @@ position: relative; } } + .newFileMenu li>.menuitem>.text { + margin-left: 10px; + } diff --git a/src/views/share/index.vue b/src/views/share/index.vue index a6818a7..044e009 100644 --- a/src/views/share/index.vue +++ b/src/views/share/index.vue @@ -480,6 +480,7 @@ // 复制分享链接 copyShareLink() { var clipboard = new Clipboard('.tag-share-link') + console.log(clipboard) clipboard.on('success', e => { this.$message({ message: '复制成功',