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 {}
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

View File

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