forked from github/dataease
Merge pull request #5268 from dataease/pr@dev@refactor_refresh-menu
refactor: 不同用户登录及时清理历史菜单缓存 #5118
This commit is contained in:
commit
e09ce362c6
@ -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