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 {}
|
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
|
||||||
|
|||||||
@@ -58,15 +58,28 @@ const emits = defineEmits(["on-stage-manage"]);
|
|||||||
const handleCommand = (command: string) => {
|
const handleCommand = (command: string) => {
|
||||||
if (command === "logout") {
|
if (command === "logout") {
|
||||||
// 退出登录
|
// 退出登录
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
"确认退出登录?",
|
||||||
|
"提示",
|
||||||
|
{
|
||||||
|
confirmButtonText: "确认",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
tokenManager.clearStorage();
|
tokenManager.clearStorage();
|
||||||
router.replace({ name: "Login" });
|
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(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user