From 565c28f7e705ce31efba917706b4726ce2bb3a3d Mon Sep 17 00:00:00 2001 From: baoyu <102349094+Bytq@users.noreply.github.com> Date: Mon, 22 Apr 2024 15:06:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E6=A0=87=E5=87=86=E6=96=87=E4=BB=B6=E9=A2=84=E8=A7=88=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/preview/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/preview/index.js b/src/common/preview/index.js index 90c5be3f9..e76d60d27 100644 --- a/src/common/preview/index.js +++ b/src/common/preview/index.js @@ -54,7 +54,12 @@ async function preview (attId, type) { this.$message.error('文档未转换成功或本地读取不到该文档') return } - } else { + } else if (file.previewAttId) { + url = viewer + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + file.previewAttId) + } else if (!file.previewAttId) { + this.$message.error('文档未转换成功或本地读取不到该文档') + return + }else { url = kkFileViewUrl + '/onlinePreview?url=' + encodeURIComponent(Base64.encode(file.downLoadUrl)) + '&watermarkTxt=' + encodeURIComponent(store.getters.userInfo.userName) } }