添加 退出用户 清理localStorage

This commit is contained in:
GGJ
2024-08-16 14:21:27 +08:00
parent 14296fee16
commit 6da0974740
2 changed files with 43 additions and 1 deletions

View File

@@ -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 = ''