wenhongquan 2 жил өмнө
parent
commit
6f2ab9705c

+ 5 - 5
src/components/MarkerMap/index.tsx

@@ -1146,12 +1146,12 @@ export default defineComponent({
     };
 
     onMounted(async () => {
-      store.getAllsingleDevice();
+      // store.getAllsingleDevice();
       
-      setTimeout(() => {
-        store.getAllsingleDevice();
-        store.getAllvideoDevice();
-      }, 2000);
+      // setTimeout(() => {
+      //   store.getAllsingleDevice();
+      //   store.getAllvideoDevice();
+      // }, 2000);
 
       window.minemap.util.getJSON(
         (import.meta.env.VITE_MAP_SERVER as string) +

+ 9 - 0
src/store/useMarkerStore.ts

@@ -122,6 +122,10 @@ export default defineStore<'marker', MarkerStateType, {}, MainActionsType>(
             locations: `${item.gpsX},${item.gpsY}`,
           }));
           // console.log(this.singleDevice);
+        } catch (e) { 
+          setTimeout(() => {
+            this.getAllsingleDevice();
+          }, 1000);
         } finally {
           this.toggleLoading();
         }
@@ -155,6 +159,11 @@ export default defineStore<'marker', MarkerStateType, {}, MainActionsType>(
             locations: `${item.gpsX},${item.gpsY}`,
           }));
           // console.log(this.videoSurveillance);
+        } catch (e) { 
+          setTimeout(() => {
+            this.getAllvideoDevice();
+          }, 1000);
+
         } finally {
           this.toggleLoading();
         }