From deb4435e71d4795ad807211ceb9dd5995aa24d0b Mon Sep 17 00:00:00 2001 From: JayChou Date: Thu, 28 Nov 2024 21:00:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/userInfo/components/reacList.vue | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/views/userInfo/components/reacList.vue b/src/views/userInfo/components/reacList.vue index 21203be..b76e30e 100644 --- a/src/views/userInfo/components/reacList.vue +++ b/src/views/userInfo/components/reacList.vue @@ -24,7 +24,7 @@ link type="primary" size="small" - @click="download(row.fileUrl)" + @click="download(row.fileUrl,row.fileName)" v-if="row.uploadWorkFlag != 'no'" > 下载文件 @@ -174,8 +174,16 @@ const headerChange = (pageNumber: any) => { getList() } // 下载文件 -const download = async (url:any) => { - window.open(import.meta.env.VITE_APP_BASE_API + '/sys/common/zuopin/' + url) +const download = async (url:any,name:any) => { + // window.open(import.meta.env.VITE_APP_BASE_API + '/sys/common/zuopin/' + url) + const a = document.createElement('a') + a.style.display = 'none' + document.body.appendChild(a) + a.href = import.meta.env.VITE_APP_BASE_API + '/sys/common/zuopin/' + url + a.setAttribute('download', name); + a.click() + document.body.removeChild(a) + } const saveEvent = async (id: any) => {