diff --git a/src/layouts/admin/components/navMenus.vue b/src/layouts/admin/components/navMenus.vue index 818afe6..e6773da 100644 --- a/src/layouts/admin/components/navMenus.vue +++ b/src/layouts/admin/components/navMenus.vue @@ -51,7 +51,6 @@ - @@ -69,6 +68,7 @@ import html2canvas from 'html2canvas' import PopupPwd from './popup/password.vue' import AdminInfo from './popup/adminInfo.vue' import { useNavTabs } from '@/stores/navTabs' + const adminInfo = useAdminInfo() const navTabs = useNavTabs() const configStore = useConfig() @@ -114,6 +114,8 @@ const handleCommand = (key: string) => { break case 'layout': navTabs.closeTabs() + window.localStorage.clear() + adminInfo.reset() router.push({ name: 'login' }) break default: diff --git a/src/stores/adminInfo.ts b/src/stores/adminInfo.ts index d049068..d720dbd 100644 --- a/src/stores/adminInfo.ts +++ b/src/stores/adminInfo.ts @@ -47,6 +47,46 @@ export const useAdminInfo = defineStore('adminInfo', { dataFill(state: AdminInfo) { this.$state = { ...this.$state, ...state } }, + reset() { + this.$state = { + access_token: '', + token_type: '', + refresh_token: '', + expires_in: 0, + scope: '', + nickname: '', + userType: 0, + deptIndex: '', + userIndex: '', + client_id: '', + headSculpture: '', + jti: '', + name: '', + deptId: '', + phone: '', + email: '', + limitIpStart: '', + limitIpEnd: '', + limitTime: '', + casualUser: 0, + type: 0, + smsNotice: 0, + emailNotice: 0, + role: [], + devCode: '', + id: '', + loginName: '', + state: 0, + registerTime: '', + loginTime: '', + deptName: '', + areaId: '', + areaName: '', + deptLevel: 0, + roleList: [], + roleCode: [] + } + }, removeToken() { this.access_token = '' this.refresh_token = ''