From a20908729360fce09c17e93ab917ab32a5e909d9 Mon Sep 17 00:00:00 2001 From: han2015 <1019850453@qq.com> Date: Tue, 10 Jun 2025 16:43:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3KKFile=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E4=B8=AD=E6=96=87=E5=AD=97=E7=AC=A6=E5=92=8C?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/doc/share.vue | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/views/doc/share.vue b/src/views/doc/share.vue index a69a064..9a04f10 100644 --- a/src/views/doc/share.vue +++ b/src/views/doc/share.vue @@ -103,12 +103,22 @@ function onShareMember(row:matterInfo){ //文件预览 function onShareView(row:matterInfo){ - if(row.name.endsWith('...')){ - row.name="archive.zip" + let a=row.name; + if(a.endsWith('...')){ + a=`${row.uuid}-${row.code}.zip` } - let _url=`${siteHost}${apiURL}/share/zip?shareUuid=${row.uuid}&code=${row.code}&puuid=root&rootUuid=root&fullfilename=${row.name}` + + //由于预览服务在缓存文件时,直接按文件名缓存,所以同名文件就会出现覆盖错乱的问题 + a=a.match("(\.[a-zA-Z]+)$") + if (a && a.length>0) { + a=`${row.uuid}-${row.code}${a[0]}` + }else{ + a=`${row.uuid}${row.name}` + } + + let _url=`${siteHost}${apiURL}/share/zip?shareUuid=${row.uuid}&code=${row.code}&uid=${uid}&puuid=root&rootUuid=root&fullfilename=${a}` dynamicVNode.value=h(preview,{ - url:`${officeHost}/onlinePreview?url=`+encodeURIComponent(btoa(_url)), + url:`${officeHost}/onlinePreview?url=`+window.btoa(unescape(encodeURIComponent(_url))), closeFunc:()=>dynamicVNode.value=null }) }