From 9f16b5c553b479ea12fe368a7ecc748872ea8b98 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期四, 12 六月 2025 11:11:27 +0800
Subject: [PATCH] 修改配置文件

---
 web_src/src/components/CloudRecordDetail.vue |   37 ++++++++++++++++++++++++++-----------
 1 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/web_src/src/components/CloudRecordDetail.vue b/web_src/src/components/CloudRecordDetail.vue
index cd0bc3c..27a2235 100755
--- a/web_src/src/components/CloudRecordDetail.vue
+++ b/web_src/src/components/CloudRecordDetail.vue
@@ -45,8 +45,7 @@
                   <i class="el-icon-video-camera"  ></i>
                   {{ getFileShowName(item) }}
                 </el-tag>
-                <a class="el-icon-download" style="color: #409EFF;font-weight: 600;margin-left: 10px;"
-                   :href="`${getFileBasePath(item)}/download.html?url=download/${app}/${stream}/${chooseDate}/${item.fileName}`"
+                <a class="el-icon-download" @click="downloadFile(item)" style="color: #409EFF;font-weight: 600;margin-left: 10px;"
                    target="_blank"/>
               </li>
             </ul>
@@ -230,9 +229,6 @@
 		mounted() {
       this.recordListStyle.height = this.winHeight + "px";
       this.playerStyle["height"] = this.winHeight + "px";
-      console.log(this.app)
-      console.log(this.stream)
-      console.log(this.mediaServerId)
       // 鏌ヨ褰撳勾鏈夎棰戠殑鏃ユ湡
       this.getDateInYear(()=>{
         if (Object.values(this.dateFilesObj).length > 0){
@@ -338,18 +334,37 @@
           }).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()
       },
       getFileShowName(item) {
-          return  moment.unix(item.startTime).format('HH:mm:ss') + "-" + moment.unix(item.endTime).format('HH:mm:ss')
+          return  moment(item.startTime).format('HH:mm:ss') + "-" + moment(item.endTime).format('HH:mm:ss')
       },
       chooseMediaChange() {
 

--
Gitblit v1.8.0