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

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

parent 4e3d3abc
...@@ -45,6 +45,7 @@ import { ...@@ -45,6 +45,7 @@ import {
hexSwitch, hexSwitch,
textStyle, textStyle,
querySkipUrl, querySkipUrl,
queryProduct,
isJson, isJson,
stationData, stationData,
getVideoUrl, getVideoUrl,
...@@ -112,12 +113,13 @@ const ConfigurationView = (props) => { ...@@ -112,12 +113,13 @@ const ConfigurationView = (props) => {
let devicesCode = []; let devicesCode = [];
const globalConfig = window.globalConfig || config; const globalConfig = window.globalConfig || config;
let isClose = false; let isClose = false;
const product = queryProduct(globalConfig?.widgets || [], decodeURI(window.location.pathname));
const _JessibucaObj = { const _JessibucaObj = {
operateBtns: { operateBtns: {
screenshot: false, screenshot: false,
}, },
loadingText: '视频加载中', loadingText: '视频加载中',
decoder: '/JessibucaVideo/decoder.js', decoder: product ? `/${product}/JessibucaVideo/decoder.js` : '/JessibucaVideo/decoder.js',
}; };
/** **********************************获取工艺图画板信息*********************** */ /** **********************************获取工艺图画板信息*********************** */
...@@ -1484,7 +1486,9 @@ const ConfigurationView = (props) => { ...@@ -1484,7 +1486,9 @@ const ConfigurationView = (props) => {
password: list.password, password: list.password,
dataRate: 'Sub', dataRate: 'Sub',
pandavmsHost: getVideoUrl(), pandavmsHost: getVideoUrl(),
gateway: true,
address: list.address, address: list.address,
channel: list.channelID * 1,
}); });
}); });
setVideoTitle(vdName + '视频查看'); setVideoTitle(vdName + '视频查看');
......
...@@ -153,13 +153,9 @@ export const stationData = [ ...@@ -153,13 +153,9 @@ export const stationData = [
]; ];
export const getVideoUrl = () => { export const getVideoUrl = () => {
const hasGateWay = window.globalConfig?.hasGateWay;
const protocol = window.location.protocol; const protocol = window.location.protocol;
const address = window.location.origin.replace(protocol, 'ws:'); const address = protocol === "https:" ? window.location.origin.replace(protocol, 'wss:') : window.location.origin.replace(protocol, 'ws:');
const port = window.location.port; return `${address}/`;
const defaultAddress = address.replace(port, 7000);
return hasGateWay ? `${address}/` : `${defaultAddress}/`;
}; };
export const loginauthen = () => { export const loginauthen = () => {
...@@ -176,3 +172,18 @@ export const loginauthen = () => { ...@@ -176,3 +172,18 @@ export const loginauthen = () => {
}) })
.catch((err) => {}); .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