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: { camId: {
handler(newV) { handler(newV) {
this.playVideo(); this.playVideo();
}, }
immediate: true // immediate: true
} }
}, },
async mounted() { 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; code = cameraData.code;
data = cameraData.data; 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("未获取到附近的相机信息"); Message.warning("未获取到附近的相机信息");
return; return;
} }
camId = data[rangeIndex || 0]?.camId; camId = data[rangeIndex || 0]?.camId;
console.log(rangeIndex, "rangeIndex", data, data[rangeIndex], cameraData);
} }
if (camId) { if (camId) {

Loading…
Cancel
Save