diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/Video/Video.vue b/ruoyi-ui/src/views/JiHeExpressway/components/Video/Video.vue index d0682c76..9e02ecdd 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/Video/Video.vue +++ b/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() { diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/Video/videoStream.js b/ruoyi-ui/src/views/JiHeExpressway/components/Video/videoStream.js index 0a8cff9a..4aecfbf3 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/Video/videoStream.js +++ b/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) {