From 372914e06e47a01fb9dddff741038e83797c26df Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Tue, 18 Jun 2024 10:00:02 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20pdf=E9=A2=84=E8=A7=88=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=B8=80=E4=B8=AA=E9=9A=8F=E6=9C=BA=E6=95=B0=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/previewPdf.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/previewPdf.js b/src/utils/previewPdf.js index 8a923440..68342cd4 100644 --- a/src/utils/previewPdf.js +++ b/src/utils/previewPdf.js @@ -5,7 +5,10 @@ const getToken = () => Vue.ls.get(ACCESS_TOKEN) // 预览pdf const previewPdf = (id) => { - const url = `${window._CONFIG.domianURL}/sys/common/view/${id}?type=view&at=${getToken()}` + const uidGenerator = () => { + return '-' + parseInt(Math.random() * 10000 + 1, 10) + } + const url = `${window._CONFIG.domianURL}/sys/common/view/${id}?type=view&at=${getToken()}&serial=${uidGenerator()}` return `${process.env.BASE_URL}pdfjs/web/viewer.html?file=` + encodeURIComponent(url) + '&.pdf' }