fix:完善退出登录弹窗
This commit is contained in:
1
src/auto-imports.d.ts
vendored
1
src/auto-imports.d.ts
vendored
@@ -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
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user