From c7f5bf8871fde1a8ead6db8912f539af8efeacf8 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Tue, 25 Jul 2023 15:50:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=99=BB=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/MainLayout.vue | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index cad5fa9..713a478 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -31,6 +31,26 @@ v-if="$q.screen.gt.sm" > + + + + + + + 登出 + + + + @@ -52,6 +72,8 @@ import { ref, reactive } from 'vue'; import SysMenu from 'src/components/SysMenu.vue'; import { useRouter, useRoute } from 'vue-router'; +import { Dialog } from 'quasar'; +import { clearJwtToken } from 'src/configs/TokenManage'; const leftDrawerOpen = ref(false); const router = useRouter(); @@ -81,4 +103,16 @@ function onLeftResize(size: { width: number; height: number }) { leftDrawerSize.width = size.width; leftDrawerSize.height = size.height; } + +function logOut() { + Dialog.create({ + title: '登出确认', + message: '确认是否登出?', + cancel: true, + persistent: true, + }).onOk(() => { + clearJwtToken(); + router.push({ name: 'login' }); + }); +}