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