Commit 6b058a3f authored by 李纪文's avatar 李纪文

fix: 修改视频查看组件问题

parent 4e3d3abc
......@@ -45,6 +45,7 @@ import {
hexSwitch,
textStyle,
querySkipUrl,
queryProduct,
isJson,
stationData,
getVideoUrl,
......@@ -112,12 +113,13 @@ const ConfigurationView = (props) => {
let devicesCode = [];
const globalConfig = window.globalConfig || config;
let isClose = false;
const product = queryProduct(globalConfig?.widgets || [], decodeURI(window.location.pathname));
const _JessibucaObj = {
operateBtns: {
screenshot: false,
},
loadingText: '视频加载中',
decoder: '/JessibucaVideo/decoder.js',
decoder: product ? `/${product}/JessibucaVideo/decoder.js` : '/JessibucaVideo/decoder.js',
};
/** **********************************获取工艺图画板信息*********************** */
......@@ -1484,7 +1486,9 @@ const ConfigurationView = (props) => {
password: list.password,
dataRate: 'Sub',
pandavmsHost: getVideoUrl(),
gateway: true,
address: list.address,
channel: list.channelID * 1,
});
});
setVideoTitle(vdName + '视频查看');
......
......@@ -153,13 +153,9 @@ export const stationData = [
];
export const getVideoUrl = () => {
const hasGateWay = window.globalConfig?.hasGateWay;
const protocol = window.location.protocol;
const address = window.location.origin.replace(protocol, 'ws:');
const port = window.location.port;
const defaultAddress = address.replace(port, 7000);
return hasGateWay ? `${address}/` : `${defaultAddress}/`;
const address = protocol === "https:" ? window.location.origin.replace(protocol, 'wss:') : window.location.origin.replace(protocol, 'ws:');
return `${address}/`;
};
export const loginauthen = () => {
......@@ -176,3 +172,18 @@ export const loginauthen = () => {
})
.catch((err) => {});
};
// 菜单查找Product
export const queryProduct = (data, url) => {
let res = null;
for (let i = 0; i < data.length; i++) {
if (url.indexOf(data[i].url) > -1) {
res = data[i];
return data[i];
} else if (data[i].widgets && data[i].widgets.length > 0) {
res = queryProduct(data[i].widgets, url);
}
if (res) break;
}
return res;
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment