Browse Source

fix bug 摄像头

wangqin
qingzhengli 8 months ago
parent
commit
b99a6ba472
  1. 4
      ruoyi-ui/src/views/JiHeExpressway/components/Video/Video.vue
  2. 7
      ruoyi-ui/src/views/JiHeExpressway/components/Video/videoStream.js

4
ruoyi-ui/src/views/JiHeExpressway/components/Video/Video.vue

@ -40,8 +40,8 @@ export default {
camId: {
handler(newV) {
this.playVideo();
},
immediate: true
}
// immediate: true
}
},
async mounted() {

7
ruoyi-ui/src/views/JiHeExpressway/components/Video/videoStream.js

@ -74,11 +74,16 @@ async function getUrl({ camId, url, pileNum, rangeIndex } = {}) {
}
code = cameraData.code;
data = cameraData.data;
if (code != 200 || !data?.length) {
// console.log(rangeIndex, "rangeIndex", cameraData);
if (
code != 200 ||
(Array.isArray(data) ? !data?.length : !Object.keys(data || {}).length)
) {
Message.warning("未获取到附近的相机信息");
return;
}
camId = data[rangeIndex || 0]?.camId;
console.log(rangeIndex, "rangeIndex", data, data[rangeIndex], cameraData);
}
if (camId) {

Loading…
Cancel
Save