From b80ee8c883f279e843071e6b53ab9cddec3f88a0 Mon Sep 17 00:00:00 2001
From: 胡思旗 <931347610@qq.com>
Date: Tue, 29 Aug 2023 15:07:13 +0800
Subject: [PATCH] 登录流程对接、项目列表组件封装

---
 src/components/common/topbar.vue |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/components/common/topbar.vue b/src/components/common/topbar.vue
index 4f0bff3..cc2df69 100644
--- a/src/components/common/topbar.vue
+++ b/src/components/common/topbar.vue
@@ -40,7 +40,7 @@
 import { message } from 'ant-design-vue'
 import { defineComponent, onMounted, ref } from 'vue'
 import { getRoot } from '/@/root'
-import { getPlatformInfo } from '/@/api/manage'
+import { getPlatformInfo, loginOut } from '/@/api/manage'
 import { ELocalStorageKey, ERouterName } from '/@/types'
 import { UserOutlined, ExportOutlined } from '@ant-design/icons-vue'
 import cloudapi from '/@/assets/icons/cloudapi.png'
@@ -60,11 +60,12 @@
 }
 const username = ref(localStorage.getItem(ELocalStorageKey.Username))
 const workspaceName = ref('')
+
 const options = [
-  { key: 0, label: ERouterName.WORKSPACE.charAt(0).toUpperCase() + ERouterName.WORKSPACE.substr(1), path: '/' + ERouterName.WORKSPACE },
-  { key: 1, label: ERouterName.MEMBERS.charAt(0).toUpperCase() + ERouterName.MEMBERS.substr(1), path: '/' + ERouterName.MEMBERS },
-  { key: 2, label: ERouterName.DEVICES.charAt(0).toUpperCase() + ERouterName.DEVICES.substr(1), path: '/' + ERouterName.DEVICES },
-  { key: 3, label: ERouterName.FIRMWARES.charAt(0).toUpperCase() + ERouterName.FIRMWARES.substr(1), path: '/' + ERouterName.FIRMWARES },
+  { key: 0, label: '项目', path: '/' + ERouterName.PROJECT },
+  { key: 1, label: '人员管理', path: '/' + ERouterName.MEMBERS },
+  { key: 2, label: '设备管理', path: '/' + ERouterName.DEVICES },
+  // { key: 3, label: ERouterName.FIRMWARES.charAt(0).toUpperCase() + ERouterName.FIRMWARES.substr(1), path: '/' + ERouterName.FIRMWARES },
 ]
 
 const selected = ref<string>(root.$route.path)
@@ -79,9 +80,11 @@
   selected.value = path
 }
 
-const logout = () => {
+const logout = async () => {
+  const res = await loginOut()
+  console.log(res, 'Res')
   localStorage.clear()
-  root.$router.push(ERouterName.PROJECT)
+  root.$router.push(ERouterName.LOGIN)
 }
 </script>
 

--
Gitblit v1.9.3