forked from github/dataease
refactor: 不同用户登录及时清理历史菜单缓存 #5118
This commit is contained in:
parent
4ef0c28431
commit
6d7f5388e7
@ -109,6 +109,13 @@ const actions = {
|
||||
if (!data) {
|
||||
reject('Verification failed, please Login again.')
|
||||
}
|
||||
const historyUserId = localStorage.getItem('userId')
|
||||
if(historyUserId && historyUserId !== data.userId+''){
|
||||
const clearLocalStorage = [ 'panel-main-tree', 'panel-default-tree','chart-tree','dataset-tree']
|
||||
clearLocalStorage.forEach((item) => {
|
||||
localStorage.removeItem(item)
|
||||
})
|
||||
}
|
||||
localStorage.setItem('userId', data.userId)
|
||||
const currentUser = data
|
||||
commit('SET_USER', currentUser)
|
||||
|
Loading…
Reference in New Issue
Block a user