From 67338a9d75216fd17bf5d679e585c21a9f10a451 Mon Sep 17 00:00:00 2001
From: husq <931347610@qq.com>
Date: Thu, 21 Sep 2023 19:01:45 +0800
Subject: [PATCH] webSocket取消订阅、订阅发布修改

---
 src/components/common/sidebar.vue |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/components/common/sidebar.vue b/src/components/common/sidebar.vue
index a9be91d..bffcb59 100644
--- a/src/components/common/sidebar.vue
+++ b/src/components/common/sidebar.vue
@@ -28,7 +28,8 @@
 import { getRoot } from '/@/root'
 import * as icons from '@ant-design/icons-vue'
 import { ERouterName } from '/@/types'
-
+import { testUnBind } from '/@/api/manage'
+import { useMyStore } from '/@/store'
 interface IOptions {
   key: number
   label: string
@@ -60,16 +61,18 @@
       { key: 4, label: '航线库', path: '/' + ERouterName.WAYLINE, icon: 'NodeIndexOutlined' },
       { key: 5, label: '计划库', path: '/' + ERouterName.TASK, icon: 'CalendarOutlined' }
     ]
-
+    const store = useMyStore()
     function selectedRoute (item: IOptions) {
       const path = typeof item.path === 'string' ? item.path : item.path.path
       return root.$route.path?.indexOf(path) === 0
     }
-
-    function goBack () {
+    const snList = computed(() => store.state.common.snList)
+    async function goBack () {
+      snList.value.forEach(async (v: string) => {
+        await testUnBind(v)
+      })
       root.$router.push('/' + ERouterName.PROJECT_LIST)
     }
-
     return {
       options,
       selectedRoute,

--
Gitblit v1.9.3