Przeglądaj źródła

fix:线程修改

贾宇博 1 miesiąc temu
rodzic
commit
d7c814f0b5
1 zmienionych plików z 6 dodań i 1 usunięć
  1. 6 1
      src/store/modules/sidebar.js

+ 6 - 1
src/store/modules/sidebar.js

@@ -13,7 +13,8 @@ const useSidebarStore = defineStore(
       state: () => ({
         badgeObj: {
           xxtzGqxxtzNum: '0'  // 消息通知-股权消息通知
-        }
+        },
+        ws: null
       }),
 
 
@@ -25,6 +26,10 @@ const useSidebarStore = defineStore(
             //   this.badgeObj.xxtzGqxxtzNum = res.data;
             // }
           // })
+
+          if (this.ws) {
+            this.ws.close();
+          }
           
           const userStore = useUserStore()