From 9c657e26d748645e2d8bf3d9b56366a946abe3e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Thu, 11 Jan 2024 13:36:08 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=96=87=E4=BB=B6=E9=A2=84=E8=A7=88token?= =?UTF-8?q?=E6=94=B9=E4=B8=BAat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FileDisplay.vue | 2 +- src/components/ZUpload.vue | 2 +- src/utils/previewPdf.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/FileDisplay.vue b/src/components/FileDisplay.vue index 58dea4b..b1f817e 100644 --- a/src/components/FileDisplay.vue +++ b/src/components/FileDisplay.vue @@ -83,7 +83,7 @@ export default { this.$message('该文件类型不支持预览') return } - const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}` + const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}` // 图片预览,使用自己添加的组件 if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) { this.imageUrl = getFileAccessHttpUrl(file.id) diff --git a/src/components/ZUpload.vue b/src/components/ZUpload.vue index d900860..cb4ee8f 100644 --- a/src/components/ZUpload.vue +++ b/src/components/ZUpload.vue @@ -179,7 +179,7 @@ export default { this.$message(this.$t('uploadFile.cannotPreview')) return } - const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}` + const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}` // 图片预览,使用自己添加的组件 if (FILE_TYPE_IMGS.includes(fileSuffix)) { this.imageUrl = getFileAccessHttpUrl(file.id) diff --git a/src/utils/previewPdf.js b/src/utils/previewPdf.js index 63088d9..8a92344 100644 --- a/src/utils/previewPdf.js +++ b/src/utils/previewPdf.js @@ -5,7 +5,7 @@ const getToken = () => Vue.ls.get(ACCESS_TOKEN) // 预览pdf const previewPdf = (id) => { - const url = `${window._CONFIG.domianURL}/sys/common/view/${id}?type=view&token=${getToken()}` + const url = `${window._CONFIG.domianURL}/sys/common/view/${id}?type=view&at=${getToken()}` return `${process.env.BASE_URL}pdfjs/web/viewer.html?file=` + encodeURIComponent(url) + '&.pdf' }