From 69185d3db83ff603bd9ef8555c5397167e844a16 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Tue, 30 Apr 2024 17:51:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=91=E7=AB=AF=E5=BD=95?= =?UTF-8?q?=E5=83=8F=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/src/components/CloudRecordDetail.vue | 32 +++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/web_src/src/components/CloudRecordDetail.vue b/web_src/src/components/CloudRecordDetail.vue index 9bf20cb8..27a2235e 100755 --- a/web_src/src/components/CloudRecordDetail.vue +++ b/web_src/src/components/CloudRecordDetail.vue @@ -45,8 +45,7 @@ {{ getFileShowName(item) }} - @@ -335,12 +334,31 @@ }).catch((error) => { console.log(error); }); - // - // - // this.videoUrl = `${this.getFileBasePath(file)}/download/${this.app}/${this.stream}/${this.chooseDate}/${file.fileName}` - // console.log(this.videoUrl) } - + }, + downloadFile(file){ + console.log(file) + this.$axios({ + method: 'get', + url: `/api/cloud/record/play/path`, + params: { + recordId: file.id, + } + }).then((res) => { + console.log(res) + const link = document.createElement('a'); + link.target = "_blank"; + if (res.data.code === 0) { + if (location.protocol === "https:") { + link.href = res.data.data.httpsPath + "&save_name=" + file.fileName; + }else { + link.href = res.data.data.httpPath + "&save_name=" + file.fileName; + } + link.click(); + } + }).catch((error) => { + console.log(error); + }); }, backToList() { this.$router.back()