فهرست منبع

fix: 修复流地址为空时保密保卫组件不显示的问题

ai0197 1 ماه پیش
والد
کامیت
c12ddf6f80
1فایلهای تغییر یافته به همراه13 افزوده شده و 9 حذف شده
  1. 13 9
      src/views/security-confidentiality/overview/components/SecurityPosition.vue

+ 13 - 9
src/views/security-confidentiality/overview/components/SecurityPosition.vue

@@ -67,7 +67,7 @@
   };
 
   const getCameraUrl = (val: CameraInfo) => {
-    if (val.pushStreamDTO && val.pushStreamDTO.videoUrls) {
+    if (val.pushStreamDTO && val.pushStreamDTO.videoUrls.pushstreamIp) {
       const videoUrl = val.pushStreamDTO.videoUrls.pushstreamIp;
       const protocol = isHttps() ? 'wss' : 'ws';
       // 如果是绝对地址
@@ -97,15 +97,19 @@
     getSecurityPositionList({
       groupName: '',
       cameraName: '',
-    }).then((res) => {
-      securityPositionCameraInfo.value = res.flatMap((item) => {
-        return item.children.map((child) => ({
-          ...child,
-          positionName: item.groupName,
-        }));
+    })
+      .then((res) => {
+        securityPositionCameraInfo.value = res.flatMap((item) => {
+          return item.children.map((child) => ({
+            ...child,
+            positionName: item.groupName,
+          }));
+        });
+        positionCameraCount.value = securityPositionCameraInfo.value.length;
+      })
+      .catch((err) => {
+        console.log(err);
       });
-      positionCameraCount.value = securityPositionCameraInfo.value.length;
-    });
   });
 
   window.onresize = () => {