fix:完善退出登录弹窗

This commit is contained in:
liangdong
2025-12-31 20:57:14 +08:00
parent bd2a143db8
commit f69d83d3ea
2 changed files with 20 additions and 6 deletions

View File

@@ -7,6 +7,7 @@
export {} export {}
declare global { declare global {
const EffectScope: typeof import('vue').EffectScope const EffectScope: typeof import('vue').EffectScope
const ElMessageBox: typeof import('element-plus/es').ElMessageBox
const acceptHMRUpdate: typeof import('pinia').acceptHMRUpdate const acceptHMRUpdate: typeof import('pinia').acceptHMRUpdate
const computed: typeof import('vue').computed const computed: typeof import('vue').computed
const createApp: typeof import('vue').createApp const createApp: typeof import('vue').createApp

View File

@@ -58,15 +58,28 @@ const emits = defineEmits(["on-stage-manage"]);
const handleCommand = (command: string) => { const handleCommand = (command: string) => {
if (command === "logout") { if (command === "logout") {
// 退出登录 // 退出登录
tokenManager.clearStorage(); ElMessageBox.confirm(
router.replace({ name: "Login" }); "确认退出登录?",
"提示",
{
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
tokenManager.clearStorage();
window.location.reload();
})
.catch(() => {
console.log('cancel')
});
} }
}; };
const onStageManage = () => {
const onStageManage = () =>{ emits("on-stage-manage");
emits('on-stage-manage') };
}
// 获取当前的用户的数据信息 // 获取当前的用户的数据信息
const userInfo = computed(() => { const userInfo = computed(() => {