From f69d83d3ea475b124f91ee05f085d13f62c6d010 Mon Sep 17 00:00:00 2001 From: liangdong Date: Wed, 31 Dec 2025 20:57:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=AE=8C=E5=96=84=E9=80=80=E5=87=BA?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/auto-imports.d.ts | 1 + src/pages/Layout/rightMenuGroup.vue | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/auto-imports.d.ts b/src/auto-imports.d.ts index 101b7d6..894e09e 100644 --- a/src/auto-imports.d.ts +++ b/src/auto-imports.d.ts @@ -7,6 +7,7 @@ export {} declare global { const EffectScope: typeof import('vue').EffectScope + const ElMessageBox: typeof import('element-plus/es').ElMessageBox const acceptHMRUpdate: typeof import('pinia').acceptHMRUpdate const computed: typeof import('vue').computed const createApp: typeof import('vue').createApp diff --git a/src/pages/Layout/rightMenuGroup.vue b/src/pages/Layout/rightMenuGroup.vue index d6d7827..ac25c4e 100644 --- a/src/pages/Layout/rightMenuGroup.vue +++ b/src/pages/Layout/rightMenuGroup.vue @@ -58,15 +58,28 @@ const emits = defineEmits(["on-stage-manage"]); const handleCommand = (command: string) => { if (command === "logout") { // 退出登录 - tokenManager.clearStorage(); - router.replace({ name: "Login" }); + ElMessageBox.confirm( + "确认退出登录?", + "提示", + { + confirmButtonText: "确认", + cancelButtonText: "取消", + type: "warning", + } + ) + .then(() => { + tokenManager.clearStorage(); + window.location.reload(); + }) + .catch(() => { + console.log('cancel') + }); } }; - -const onStageManage = () =>{ - emits('on-stage-manage') -} +const onStageManage = () => { + emits("on-stage-manage"); +}; // 获取当前的用户的数据信息 const userInfo = computed(() => {