diff --git a/src/components/_base/exit-account-modal/img/icon1.png b/src/components/_base/exit-account-modal/img/icon1.png new file mode 100644 index 0000000..40402eb Binary files /dev/null and b/src/components/_base/exit-account-modal/img/icon1.png differ diff --git a/src/components/_base/exit-account-modal/index.vue b/src/components/_base/exit-account-modal/index.vue new file mode 100644 index 0000000..030e470 --- /dev/null +++ b/src/components/_base/exit-account-modal/index.vue @@ -0,0 +1,98 @@ + + + + + + diff --git a/src/components/_base/navbar/index.vue b/src/components/_base/navbar/index.vue index 04308ce..87e2fbb 100644 --- a/src/components/_base/navbar/index.vue +++ b/src/components/_base/navbar/index.vue @@ -8,6 +8,7 @@ import { useSidebarStore } from '@/stores/modules/side-bar'; import { MENU_GROUP_IDS } from '@/router/constants'; import router from '@/router'; import { useRoute } from 'vue-router'; +import ExitAccountModal from '@/components/_base/exit-account-modal/index.vue'; interface MenuItem { name: string; @@ -20,7 +21,7 @@ interface MenuItem { const lists = ref([]); const sidebarStore = useSidebarStore(); const route = useRoute(); - +const exitAccountModalRef = ref(null); const selectedKey = computed(() => { // 判断是否为工作台页面(假设路由名为 'Home' 或 path 为 '/') if (route.name === 'Home' || route.path === '/') { @@ -31,10 +32,7 @@ const selectedKey = computed(() => { }); const clickExit = async () => { - const { code } = await fetchLogOut(); - if (code === 200) { - handleUserLogout(); - } + exitAccountModalRef.value?.open(); }; const getMenus = async () => { const res = await fetchMenusTree(); @@ -112,31 +110,37 @@ const handleDopdownClick = (index: any, ind: any) => {