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(() => {