From 87018471c0198a3bf74afc8ce953c7de0cce87de Mon Sep 17 00:00:00 2001 From: zyn Date: Thu, 1 Feb 2024 09:58:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E9=A2=84=E8=A7=88=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/preview/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/preview/index.js b/src/common/preview/index.js index 0fba21c5f..4bbde6786 100644 --- a/src/common/preview/index.js +++ b/src/common/preview/index.js @@ -39,7 +39,11 @@ async function preview (attId, type) { url = 'book://ssreader/e0?url=' + file.downLoadUrl } } else if (file.fileSuffix.toLowerCase() === 'pdf') { - url = './static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + file.id) + let viewer = '/static/pdf/web/viewer.html?file=' + if (isMobile()) { + viewer = '/static/pdf_old/web/viewer.html?file=' + } + url = viewer + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + file.id) } else { // onlyoffice在线编辑文件转换为pdf预览 -> kkfileview预览乱码 if (file.onlined && file.onlined === 1) { From eea914c3f4124600f78e1be2b390b76902f2eac3 Mon Sep 17 00:00:00 2001 From: zyn Date: Thu, 1 Feb 2024 10:15:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E9=A2=84=E8=A7=88=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/preview/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/preview/index.js b/src/common/preview/index.js index 4bbde6786..90c5be3f9 100644 --- a/src/common/preview/index.js +++ b/src/common/preview/index.js @@ -29,6 +29,10 @@ async function preview (attId, type) { } const res = await getBusStandFileByAttId({ attId }) if (res.ok && res.data) { + let viewer = '/static/pdf/web/viewer.html?file=' + if (isMobile()) { + viewer = '/static/pdf_old/web/viewer.html?file=' + } const file = res.data let url = '' if (file.fileSuffix.toLowerCase() === 'pdg') { @@ -39,17 +43,13 @@ async function preview (attId, type) { url = 'book://ssreader/e0?url=' + file.downLoadUrl } } else if (file.fileSuffix.toLowerCase() === 'pdf') { - let viewer = '/static/pdf/web/viewer.html?file=' - if (isMobile()) { - viewer = '/static/pdf_old/web/viewer.html?file=' - } url = viewer + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + file.id) } else { // onlyoffice在线编辑文件转换为pdf预览 -> kkfileview预览乱码 if (file.onlined && file.onlined === 1) { const res = await queryConvertAtt({ attId }) if (res.ok && res.data) { - url = '/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + res.data.attId) + url = viewer + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + res.data.attId) } else { this.$message.error('文档未转换成功或本地读取不到该文档') return