Commit 58d1f0ea16d95638d50d691a7a0169c83c8550af
1 parent
3b1516af
修复云端录像界面
Showing
3 changed files
with
16 additions
and
2 deletions
src/main/java/com/genersoft/iot/vmp/conf/ProxyServletConfig.java
| @@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.conf; | @@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.conf; | ||
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; | 3 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| 4 | import com.genersoft.iot.vmp.service.IMediaServerService; | 4 | import com.genersoft.iot.vmp.service.IMediaServerService; |
| 5 | +import org.apache.catalina.connector.ClientAbortException; | ||
| 5 | import org.apache.http.HttpHost; | 6 | import org.apache.http.HttpHost; |
| 6 | import org.apache.http.HttpRequest; | 7 | import org.apache.http.HttpRequest; |
| 7 | import org.apache.http.HttpResponse; | 8 | import org.apache.http.HttpResponse; |
| @@ -193,6 +194,12 @@ public class ProxyServletConfig { | @@ -193,6 +194,12 @@ public class ProxyServletConfig { | ||
| 193 | } catch (IOException ioException) { | 194 | } catch (IOException ioException) { |
| 194 | if (ioException instanceof ConnectException) { | 195 | if (ioException instanceof ConnectException) { |
| 195 | logger.error("录像服务 连接失败"); | 196 | logger.error("录像服务 连接失败"); |
| 197 | + }else if (ioException instanceof ClientAbortException) { | ||
| 198 | + /** | ||
| 199 | + * TODO 使用这个代理库实现代理在遇到代理视频文件时,如果是206结果,会遇到报错蛋市目前功能正常, | ||
| 200 | + * TODO 暂时去除异常处理。后续使用其他代理框架修改测试 | ||
| 201 | + */ | ||
| 202 | + | ||
| 196 | }else { | 203 | }else { |
| 197 | logger.error("录像服务 代理失败: ", e); | 204 | logger.error("录像服务 代理失败: ", e); |
| 198 | } | 205 | } |
src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java
| @@ -84,6 +84,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | @@ -84,6 +84,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | ||
| 84 | matchers.add("/v3/api-docs/**"); | 84 | matchers.add("/v3/api-docs/**"); |
| 85 | matchers.add("/js/**"); | 85 | matchers.add("/js/**"); |
| 86 | matchers.add("/api/device/query/snap/**"); | 86 | matchers.add("/api/device/query/snap/**"); |
| 87 | + matchers.add("/record_proxy/*/**"); | ||
| 88 | + matchers.add("/zlm_Proxy/FhTuMYqB2HeCuNOb/record/t/1/2023-03-25/16:35:07-16:35:16-9353.mp4"); | ||
| 87 | matchers.addAll(userSetting.getInterfaceAuthenticationExcludes()); | 89 | matchers.addAll(userSetting.getInterfaceAuthenticationExcludes()); |
| 88 | // 可以直接访问的静态数据 | 90 | // 可以直接访问的静态数据 |
| 89 | web.ignoring().antMatchers(matchers.toArray(new String[0])); | 91 | web.ignoring().antMatchers(matchers.toArray(new String[0])); |
| @@ -119,7 +121,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | @@ -119,7 +121,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | ||
| 119 | .authorizeRequests() | 121 | .authorizeRequests() |
| 120 | .requestMatchers(CorsUtils::isPreFlightRequest).permitAll() | 122 | .requestMatchers(CorsUtils::isPreFlightRequest).permitAll() |
| 121 | .antMatchers(userSetting.getInterfaceAuthenticationExcludes().toArray(new String[0])).permitAll() | 123 | .antMatchers(userSetting.getInterfaceAuthenticationExcludes().toArray(new String[0])).permitAll() |
| 122 | - .antMatchers("/api/user/login","/index/hook/**").permitAll() | 124 | + .antMatchers("/api/user/login","/index/hook/**","/zlm_Proxy/FhTuMYqB2HeCuNOb/record/t/1/2023-03-25/16:35:07-16:35:16-9353.mp4").permitAll() |
| 123 | .anyRequest().authenticated() | 125 | .anyRequest().authenticated() |
| 124 | // 异常处理器 | 126 | // 异常处理器 |
| 125 | .and() | 127 | .and() |
web_src/src/components/CloudRecordDetail.vue
| @@ -220,14 +220,18 @@ | @@ -220,14 +220,18 @@ | ||
| 220 | } | 220 | } |
| 221 | this.queryRecordDetails(()=>{ | 221 | this.queryRecordDetails(()=>{ |
| 222 | if (this.detailFiles.length > 0){ | 222 | if (this.detailFiles.length > 0){ |
| 223 | + console.log(this.detailFiles) | ||
| 223 | let timeForFile = this.getTimeForFile(this.detailFiles[0]); | 224 | let timeForFile = this.getTimeForFile(this.detailFiles[0]); |
| 224 | let lastTimeForFile = this.getTimeForFile(this.detailFiles[this.detailFiles.length - 1]); | 225 | let lastTimeForFile = this.getTimeForFile(this.detailFiles[this.detailFiles.length - 1]); |
| 225 | let timeNum = timeForFile[0].getTime() - new Date(this.chooseDate + " " + this.timeFormat).getTime() | 226 | let timeNum = timeForFile[0].getTime() - new Date(this.chooseDate + " " + this.timeFormat).getTime() |
| 227 | + console.log(timeNum) | ||
| 226 | let lastTimeNum = lastTimeForFile[1].getTime() - new Date(this.chooseDate + " " + this.timeFormat).getTime() | 228 | let lastTimeNum = lastTimeForFile[1].getTime() - new Date(this.chooseDate + " " + this.timeFormat).getTime() |
| 227 | 229 | ||
| 228 | this.playTime = parseInt(timeNum/1000) | 230 | this.playTime = parseInt(timeNum/1000) |
| 229 | this.sliderMIn = parseInt(timeNum/1000 - timeNum/1000%(60*60)) | 231 | this.sliderMIn = parseInt(timeNum/1000 - timeNum/1000%(60*60)) |
| 232 | + console.log(this.sliderMIn ) | ||
| 230 | this.sliderMax = parseInt(lastTimeNum/1000 - lastTimeNum/1000%(60*60)) + 60*60 | 233 | this.sliderMax = parseInt(lastTimeNum/1000 - lastTimeNum/1000%(60*60)) + 60*60 |
| 234 | + console.log(this.sliderMax ) | ||
| 231 | } | 235 | } |
| 232 | }); | 236 | }); |
| 233 | }, | 237 | }, |
| @@ -311,11 +315,12 @@ | @@ -311,11 +315,12 @@ | ||
| 311 | } | 315 | } |
| 312 | }, | 316 | }, |
| 313 | getTimeForFile(file){ | 317 | getTimeForFile(file){ |
| 318 | + console.log(file) | ||
| 314 | let timeStr = file.substring(0,17); | 319 | let timeStr = file.substring(0,17); |
| 315 | if(timeStr.indexOf("~") > 0){ | 320 | if(timeStr.indexOf("~") > 0){ |
| 316 | timeStr = timeStr.replaceAll("-",":") | 321 | timeStr = timeStr.replaceAll("-",":") |
| 317 | } | 322 | } |
| 318 | - let timeArr = timeStr.split("~"); | 323 | + let timeArr = timeStr.split("-"); |
| 319 | let starTime = new Date(this.chooseDate + " " + timeArr[0]); | 324 | let starTime = new Date(this.chooseDate + " " + timeArr[0]); |
| 320 | let endTime = new Date(this.chooseDate + " " + timeArr[1]); | 325 | let endTime = new Date(this.chooseDate + " " + timeArr[1]); |
| 321 | if(this.checkIsOver24h(starTime,endTime)){ | 326 | if(this.checkIsOver24h(starTime,endTime)){ |