Commit da9fcf8f by 潘建波

【BUG】兼容HTTPS的图片展示和视频播放

1 parent 6ad19ddf
{"commit":"cf3ae4a5b19c6eb0b2689a9834d66b36b7bc3519","commitDate":"2021-7-16 14:21","buildDate":"2021-7-20 19:20","version":"2.1.0","info":"临时提交"}
\ No newline at end of file
{"commit":"6ad19ddfe788a0e2a7d6aabcd3fc71e4755f27d9","commitDate":"2021-7-20 19:36","buildDate":"2021-8-9 19:25","version":"2.1.0","info":"【BUG】修改28181无法下发任务问题"}
\ No newline at end of file
......@@ -13,8 +13,8 @@ let wsIP = "";
let flvIP = "";
switch (process.env.NODE_ENV) {
case "development":
wsIP = window.config.https?"192.168.9.227:20070":"192.168.9.233:20080"; // 测试环境url
flvIP = window.config.https?"192.168.9.233:8080":"192.168.9.233:8080";
wsIP = window.config.https?"192.168.9.227":"192.168.9.233"; // 测试环境url
flvIP = window.config.https?"192.168.9.233":"192.168.9.233";
break;
case "pre":
wsIP = ""; // 预上线环境url
......@@ -22,7 +22,7 @@ switch (process.env.NODE_ENV) {
case "production":
wsIP = location.host; // 生产环境url
// flvIP = "192.168.9.245" + ":8080"
flvIP = location.hostname + ":8080"
flvIP = location.hostname
break;
}
export default {
......
......@@ -309,6 +309,14 @@ Vue.prototype.checkchrome = function() {
var isWebKit = navigator.userAgent.indexOf('WebKit') > -1 //
return isWebKit
};
/**
* https路径处理
*/
Vue.prototype.buildImgurl = function(url){
let uri = window.config.https? url.replace('http','https'):url;
let result = window.config.https? uri.replace('20080','20070'):uri;
return result
}
/**
* code操作
......
......@@ -29,7 +29,7 @@
this.player.loop = true;
if(window.config.https) {
let loc = location.host
this.player.src = `https://${loc}/${play_url.split(":20080")[1]}`
this.player.src = `https://${loc}/${play_url.split(":20070")[1]}`
} else {
this.player.src = play_url;
}
......
......@@ -143,10 +143,12 @@ export default {
})
.then((res) => {
if (!res.ecode) {
if(res.user_name !== this.ruleForm.username){
return false;
}
this.loginMount(res, "user");
} else {
if (res.ecode == "1000") {
debugger
sessionStorage.setItem("user_unid", res.user_unid);
localStorage.setItem("atoken", res.atoken);
this.$router.push("/resetpass")
......
......@@ -132,7 +132,6 @@ export default {
});
},
subTasksClick(vdata) {
console.log(vdata);
//删除中的任务不能点击
if (vdata.enableStatus == 5) {
return;
......@@ -195,8 +194,9 @@ export default {
getPlayUrl: function() {
if(this.ischrome) {
let ip = this.$api.flvIP;
let url = `http://${ip}/live/${this.currentSubtaskId}.flv`
let url = `${window.config.https?'https':'http'}://${ip}:${window.config.https?'20070':'8080'}/live/${this.currentSubtaskId}.flv`
console.log("FLV播放地址:", url)
debugger
this.$refs.flvideo.startFunc(url);
this.streamclock = setInterval(()=> {
this.steam(this.subtaskdata)
......
......@@ -106,10 +106,10 @@
配置导出
<span class="set-icon el-icon-upload"></span>
</div>
<div class="set-item" @click="showview()">
<!-- <div class="set-item" @click="showview()">
效果展示
<span class="set-icon el-icon-s-help"></span>
</div>
</div> -->
</div>
<handleparam ref="handleparam" :subtaskid="subtaskid"></handleparam>
......@@ -193,7 +193,8 @@ export default {
} else {
this.$api.task.exportParams(this.subtaskid).then(res => {
if (res.ecode == 200) {
location.href = res.enote;
let url = res.enote;
location.href = window.config.https? url.replace('http','https'):url;
let sunbtaskname = this.subtaskdata.subtask_name;
this.$logs.oplogs(res,'serv_scene',`任务导出,任务名称:${sunbtaskname}`);
}
......@@ -254,10 +255,12 @@ export default {
TaskParams(subid) {
this.loading = true;
this.$api.task.getTaskParams(this.taskid, subid).then(res => {
this.taskInfo = res;
this.switchstate = res.alternate_status == "1" ? true : false;
this.loading = false;
this.$forceUpdate();
if(this.subtaskid == res.subtask_id){
this.taskInfo = res;
this.switchstate = res.alternate_status == "1" ? true : false;
this.loading = false;
this.$forceUpdate();
}
});
},
setTimer(data) {
......@@ -343,7 +346,6 @@ export default {
this.taskInfo.mtasks[0].scenes.map(ele => {
postions.push(ele.position_num)
});
debugger
if(postions.indexOf(positionnum) > 0) {
this.$message({
message: "预置位已经存在请重新设置!",
......
......@@ -559,7 +559,7 @@ export default {
this.$api.search
.detailImg({}, unid)
.then(res => {
this.detailImg = res.pic_url ? res.pic_url : carImg;
this.detailImg = res.pic_url ? this.buildImgurl(res.pic_url) : carImg;
})
.catch(e => {});
},
......
......@@ -691,7 +691,7 @@ export default {
this.$api.search
.detailImg({}, unid)
.then(res => {
this.detailImg = res.pic_url ? res.pic_url : carImg;
this.detailImg = res.pic_url ? this.buildImgurl(res.pic_url) : carImg;
this.srcList.push(this.detailImg);
})
.catch(e => {});
......@@ -704,6 +704,7 @@ export default {
console.log("录像路径",play_url);
setTimeout(() => {
this.$refs.visableDialog.playvideos(play_url);
console.log('videourl',url)
}, 0);
})
......
......@@ -471,7 +471,7 @@ export default {
this.$api.search
.detailImg({}, unid)
.then(res => {
this.detailImg = res.pic_url ? res.pic_url : carImg;
this.detailImg = res.pic_url ? this.buildImgurl(res.pic_url) : carImg;
})
.catch(e => {});
},
......
......@@ -476,7 +476,7 @@ export default {
this.$api.search
.detailImg({}, unid)
.then(res => {
this.detailImg = res.pic_url ? res.pic_url : carImg;
this.detailImg = res.pic_url ? this.buildImgurl(res.pic_url) : carImg;
})
.catch(e => {});
},
......
......@@ -649,11 +649,12 @@ export default {
this.$api.search
.detailImg({}, unid)
.then(res => {
this.detailImg = res.pic_url ? res.pic_url : carImg;
this.detailImg = res.pic_url ? this.buildImgurl(res.pic_url) : carImg;
this.srcList.push(this.detailImg);
})
.catch(e => {});
},
detailFun(index, row) {
this.currentIndex = index;
if (row.pics.length > 0) {
......
......@@ -764,7 +764,7 @@ export default {
this.$api.search
.detailImg({}, unid)
.then(res => {
this.detailImg = res.pic_url ? res.pic_url : carImg;
this.detailImg = res.pic_url ? this.buildImgurl(res.pic_url) : carImg;
})
.catch(e => {});
},
......
......@@ -118,7 +118,7 @@ export default {
label: "name",
children: "zones",
disabled: "disabled",
isLeaf: "leaf"
isLeaf: "leaf",
},
sessionData: {},
data: [],
......@@ -175,6 +175,7 @@ export default {
data[i].vchan.play_url = data[i].rtsp_url;
data[i].vchan.play_url = data[i].rtsp_url;
data[i].vchan.enableStatus = data[i].enableStatus;
data[i].vchan.DeviceID = data[i].vchan.vchan_refid;
} else {
data.vchan = {
subtask_id: data[i].subtask_id,
......@@ -183,7 +184,8 @@ export default {
name: data[i].subtask_name,
running_status: data[i].running_status,
play_url: data[i].rtsp_url,
enableStatus: data[i].enableStatus
enableStatus: data[i].enableStatus,
DeviceID:data[i].vchan_refid
};
}
ary.push(data[i].vchan);
......@@ -216,11 +218,11 @@ export default {
}
},
handleCheckChange(data, node) {
console.log(data);
let staus = false;
if (this.tableData.length > 0) {
console.log(this.tableData)
for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i].vchan_refid == data.vchan_refid) {
if ((this.tableData[i].vchan_refid && this.tableData[i].vchan_refid == data.vchan_refid) ||(this.tableData[i].DeviceID&&this.tableData[i].DeviceID == data.DeviceID) ) {
this.delFun(i, this.tableData[i], "tree");
staus = true;
break;
......@@ -303,7 +305,7 @@ export default {
.then(() => {
if (!data.subtask_id) {
this.tableData.forEach((ele, i) => {
if (ele.vchan_refid == data.vchan_refid) {
if ((ele.vchan_refid && ele.vchan_refid == data.vchan_refid) || (ele.DeviceID&&ele.DeviceID == data.DeviceID)) {
this.tableData.splice(i, 1);
this.checkvckan();
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!