From 514f53c6066c0f6db8f66c3677174af302bc472a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=B6=E4=B8=9C?= <1654135867@qq.com> Date: Mon, 29 Jul 2024 09:17:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E9=A2=84=E8=A7=88=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/UpfilePersion/UpfilePersionList.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jeecgboot-vue3-master/src/views/UpfilePersion/UpfilePersionList.vue b/jeecgboot-vue3-master/src/views/UpfilePersion/UpfilePersionList.vue index 5db6dd33..b427a9e3 100644 --- a/jeecgboot-vue3-master/src/views/UpfilePersion/UpfilePersionList.vue +++ b/jeecgboot-vue3-master/src/views/UpfilePersion/UpfilePersionList.vue @@ -353,7 +353,13 @@ const fileUrl = `${globalSetting.domainUrl}${getDownWork}?id=${record.id}`; const extName = record.url.substring(record.url.lastIndexOf('.')); const previewUrl = `${fileUrl}&fullfilename=${new Date().getTime()}${extName}`; - window.open(previewServerUrl + encodeURIComponent(Base64.encode(previewUrl))); + window.open(previewServerUrl + encodeURIComponent(base64Encode(previewUrl))); + } + + function base64Encode(str: string): string { + return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) { + return String.fromCharCode('0x' + p1); + })); } function handleDown(record) {