更新退出

This commit is contained in:
2025-07-28 10:58:57 +08:00
parent 6dc05dfccb
commit 4684112b97
2 changed files with 13 additions and 12 deletions

View File

@ -8,7 +8,7 @@
<div class="name">姓名{{ username }}</div>
<div class="work">单位{{ deptName }}</div>
</div>
<!-- <el-dropdown :hide-on-click="false">
<el-dropdown :hide-on-click="false">
<span class="el-dropdown-link">
<el-icon :size="20" color="#fff"> <CaretBottom /> </el-icon>
</span>
@ -17,7 +17,7 @@
<el-dropdown-item command="logout">退出登录</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown> -->
</el-dropdown>
</div>
<div @click="goToHome">
<img src="@/assets/images/meun.png" />
@ -54,7 +54,9 @@ onMounted(() => {
active.value = "LZ";
});
const logout = () => {
store.dispatch("user/logout");
window.opener = null;
window.open('', '_self');
window.close();
store.commit("app/clearTag", null, { immediate: true });
store.commit("permission/deleteRouter", { immediate: true });
store.commit("user/deleteKeepLiiveRoute", "home");

View File

@ -1,5 +1,5 @@
<template>
<!-- <el-dropdown class="avatar-container" trigger="click">
<el-dropdown class="avatar-container" trigger="click">
<div class="avatar-wrapper">
<el-avatar
shape="circle"
@ -12,7 +12,7 @@
<el-dropdown-item divided @click="logout()">退出登录</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown> -->
</el-dropdown>
<UpdatePwdDialog v-model="UpdatePwdVisible"></UpdatePwdDialog>
</template>
@ -28,13 +28,12 @@ const updatePwd = () => {
const store = useStore();
const logout = () => {
store.dispatch("user/logout");
store.commit("app/clearTag", null, {
immediate: true
});
store.commit("permission/deleteRouter", {
immediate: true
});
window.opener = null;
window.open('', '_self');
window.close();
store.commit("app/clearTag", null, { immediate: true });
store.commit("permission/deleteRouter", { immediate: true });
store.commit("user/deleteKeepLiiveRoute", "home");
};
</script>