From 58d1f0ea16d95638d50d691a7a0169c83c8550af Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期一, 27 三月 2023 15:47:04 +0800
Subject: [PATCH] 修复云端录像界面

---
 src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java |    4 +++-
 src/main/java/com/genersoft/iot/vmp/conf/ProxyServletConfig.java         |    7 +++++++
 web_src/src/components/CloudRecordDetail.vue                             |    7 ++++++-
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/conf/ProxyServletConfig.java b/src/main/java/com/genersoft/iot/vmp/conf/ProxyServletConfig.java
index ee4d850..6cc3b41 100644
--- a/src/main/java/com/genersoft/iot/vmp/conf/ProxyServletConfig.java
+++ b/src/main/java/com/genersoft/iot/vmp/conf/ProxyServletConfig.java
@@ -2,6 +2,7 @@
 
 import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
 import com.genersoft.iot.vmp.service.IMediaServerService;
+import org.apache.catalina.connector.ClientAbortException;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
@@ -193,6 +194,12 @@
             } catch (IOException ioException) {
                 if (ioException instanceof ConnectException) {
                     logger.error("褰曞儚鏈嶅姟 杩炴帴澶辫触");
+                }else if (ioException instanceof ClientAbortException) {
+                    /**
+                     * TODO 浣跨敤杩欎釜浠g悊搴撳疄鐜颁唬鐞嗗湪閬囧埌浠g悊瑙嗛鏂囦欢鏃讹紝濡傛灉鏄�206缁撴灉锛屼細閬囧埌鎶ラ敊铔嬪競鐩墠鍔熻兘姝e父锛�
+                     * TODO 鏆傛椂鍘婚櫎寮傚父澶勭悊銆傚悗缁娇鐢ㄥ叾浠栦唬鐞嗘鏋朵慨鏀规祴璇�
+                     */
+
                 }else {
                     logger.error("褰曞儚鏈嶅姟 浠g悊澶辫触锛� ", e);
                 }
diff --git a/src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java b/src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java
index c9a1233..0f75984 100644
--- a/src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java
+++ b/src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java
@@ -84,6 +84,8 @@
         matchers.add("/v3/api-docs/**");
         matchers.add("/js/**");
         matchers.add("/api/device/query/snap/**");
+        matchers.add("/record_proxy/*/**");
+        matchers.add("/zlm_Proxy/FhTuMYqB2HeCuNOb/record/t/1/2023-03-25/16:35:07-16:35:16-9353.mp4");
         matchers.addAll(userSetting.getInterfaceAuthenticationExcludes());
         // 鍙互鐩存帴璁块棶鐨勯潤鎬佹暟鎹�
         web.ignoring().antMatchers(matchers.toArray(new String[0]));
@@ -119,7 +121,7 @@
                 .authorizeRequests()
                 .requestMatchers(CorsUtils::isPreFlightRequest).permitAll()
                 .antMatchers(userSetting.getInterfaceAuthenticationExcludes().toArray(new String[0])).permitAll()
-                .antMatchers("/api/user/login","/index/hook/**").permitAll()
+                .antMatchers("/api/user/login","/index/hook/**","/zlm_Proxy/FhTuMYqB2HeCuNOb/record/t/1/2023-03-25/16:35:07-16:35:16-9353.mp4").permitAll()
                 .anyRequest().authenticated()
                 // 寮傚父澶勭悊鍣�
                 .and()
diff --git a/web_src/src/components/CloudRecordDetail.vue b/web_src/src/components/CloudRecordDetail.vue
index bacd96f..6983b54 100644
--- a/web_src/src/components/CloudRecordDetail.vue
+++ b/web_src/src/components/CloudRecordDetail.vue
@@ -220,14 +220,18 @@
         }
         this.queryRecordDetails(()=>{
           if (this.detailFiles.length > 0){
+            console.log(this.detailFiles)
             let timeForFile = this.getTimeForFile(this.detailFiles[0]);
             let lastTimeForFile = this.getTimeForFile(this.detailFiles[this.detailFiles.length - 1]);
             let timeNum = timeForFile[0].getTime() - new Date(this.chooseDate + " " + this.timeFormat).getTime()
+            console.log(timeNum)
             let lastTimeNum = lastTimeForFile[1].getTime() - new Date(this.chooseDate + " " + this.timeFormat).getTime()
 
             this.playTime = parseInt(timeNum/1000)
             this.sliderMIn = parseInt(timeNum/1000 - timeNum/1000%(60*60))
+            console.log(this.sliderMIn )
             this.sliderMax = parseInt(lastTimeNum/1000 - lastTimeNum/1000%(60*60)) + 60*60
+            console.log(this.sliderMax )
           }
         });
       },
@@ -311,11 +315,12 @@
         }
       },
       getTimeForFile(file){
+        console.log(file)
         let timeStr = file.substring(0,17);
         if(timeStr.indexOf("~") > 0){
           timeStr = timeStr.replaceAll("-",":")
         }
-        let timeArr = timeStr.split("~");
+        let timeArr = timeStr.split("-");
         let starTime = new Date(this.chooseDate + " " + timeArr[0]);
         let endTime = new Date(this.chooseDate + " " + timeArr[1]);
         if(this.checkIsOver24h(starTime,endTime)){

--
Gitblit v1.8.0