修复云端录像界面
This commit is contained in:
parent
80a8c25d65
commit
8310400ce8
@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.conf;
|
|||||||
|
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
||||||
import com.genersoft.iot.vmp.service.IMediaServerService;
|
import com.genersoft.iot.vmp.service.IMediaServerService;
|
||||||
|
import org.apache.catalina.connector.ClientAbortException;
|
||||||
import org.apache.http.HttpHost;
|
import org.apache.http.HttpHost;
|
||||||
import org.apache.http.HttpRequest;
|
import org.apache.http.HttpRequest;
|
||||||
import org.apache.http.HttpResponse;
|
import org.apache.http.HttpResponse;
|
||||||
@ -193,6 +194,12 @@ public class ProxyServletConfig {
|
|||||||
} catch (IOException ioException) {
|
} catch (IOException ioException) {
|
||||||
if (ioException instanceof ConnectException) {
|
if (ioException instanceof ConnectException) {
|
||||||
logger.error("录像服务 连接失败");
|
logger.error("录像服务 连接失败");
|
||||||
|
}else if (ioException instanceof ClientAbortException) {
|
||||||
|
/**
|
||||||
|
* TODO 使用这个代理库实现代理在遇到代理视频文件时,如果是206结果,会遇到报错蛋市目前功能正常,
|
||||||
|
* TODO 暂时去除异常处理。后续使用其他代理框架修改测试
|
||||||
|
*/
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
logger.error("录像服务 代理失败: ", e);
|
logger.error("录像服务 代理失败: ", e);
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
matchers.add("/v3/api-docs/**");
|
matchers.add("/v3/api-docs/**");
|
||||||
matchers.add("/js/**");
|
matchers.add("/js/**");
|
||||||
matchers.add("/api/device/query/snap/**");
|
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());
|
matchers.addAll(userSetting.getInterfaceAuthenticationExcludes());
|
||||||
// 可以直接访问的静态数据
|
// 可以直接访问的静态数据
|
||||||
web.ignoring().antMatchers(matchers.toArray(new String[0]));
|
web.ignoring().antMatchers(matchers.toArray(new String[0]));
|
||||||
@ -119,7 +121,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
.authorizeRequests()
|
.authorizeRequests()
|
||||||
.requestMatchers(CorsUtils::isPreFlightRequest).permitAll()
|
.requestMatchers(CorsUtils::isPreFlightRequest).permitAll()
|
||||||
.antMatchers(userSetting.getInterfaceAuthenticationExcludes().toArray(new String[0])).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()
|
.anyRequest().authenticated()
|
||||||
// 异常处理器
|
// 异常处理器
|
||||||
.and()
|
.and()
|
||||||
|
@ -220,14 +220,18 @@
|
|||||||
}
|
}
|
||||||
this.queryRecordDetails(()=>{
|
this.queryRecordDetails(()=>{
|
||||||
if (this.detailFiles.length > 0){
|
if (this.detailFiles.length > 0){
|
||||||
|
console.log(this.detailFiles)
|
||||||
let timeForFile = this.getTimeForFile(this.detailFiles[0]);
|
let timeForFile = this.getTimeForFile(this.detailFiles[0]);
|
||||||
let lastTimeForFile = this.getTimeForFile(this.detailFiles[this.detailFiles.length - 1]);
|
let lastTimeForFile = this.getTimeForFile(this.detailFiles[this.detailFiles.length - 1]);
|
||||||
let timeNum = timeForFile[0].getTime() - new Date(this.chooseDate + " " + this.timeFormat).getTime()
|
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()
|
let lastTimeNum = lastTimeForFile[1].getTime() - new Date(this.chooseDate + " " + this.timeFormat).getTime()
|
||||||
|
|
||||||
this.playTime = parseInt(timeNum/1000)
|
this.playTime = parseInt(timeNum/1000)
|
||||||
this.sliderMIn = parseInt(timeNum/1000 - timeNum/1000%(60*60))
|
this.sliderMIn = parseInt(timeNum/1000 - timeNum/1000%(60*60))
|
||||||
|
console.log(this.sliderMIn )
|
||||||
this.sliderMax = parseInt(lastTimeNum/1000 - lastTimeNum/1000%(60*60)) + 60*60
|
this.sliderMax = parseInt(lastTimeNum/1000 - lastTimeNum/1000%(60*60)) + 60*60
|
||||||
|
console.log(this.sliderMax )
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -311,11 +315,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getTimeForFile(file){
|
getTimeForFile(file){
|
||||||
|
console.log(file)
|
||||||
let timeStr = file.substring(0,17);
|
let timeStr = file.substring(0,17);
|
||||||
if(timeStr.indexOf("~") > 0){
|
if(timeStr.indexOf("~") > 0){
|
||||||
timeStr = timeStr.replaceAll("-",":")
|
timeStr = timeStr.replaceAll("-",":")
|
||||||
}
|
}
|
||||||
let timeArr = timeStr.split("~");
|
let timeArr = timeStr.split("-");
|
||||||
let starTime = new Date(this.chooseDate + " " + timeArr[0]);
|
let starTime = new Date(this.chooseDate + " " + timeArr[0]);
|
||||||
let endTime = new Date(this.chooseDate + " " + timeArr[1]);
|
let endTime = new Date(this.chooseDate + " " + timeArr[1]);
|
||||||
if(this.checkIsOver24h(starTime,endTime)){
|
if(this.checkIsOver24h(starTime,endTime)){
|
||||||
|
Loading…
Reference in New Issue
Block a user