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' }); + }); +}