🐛 更新头像与昵称后刷新界面,头像缓存问题修复

This commit is contained in:
x ronger 2020-11-11 21:39:33 +08:00
parent b4498c2550
commit 3a65bf3b0b

View File

@ -18,11 +18,6 @@ export const mutations = {
},
setUser (state, data) {
state.userInfo = data
let user = {
nickname: data.nickname,
avatarURL: data.avatarUrl
}
localStorage.setItem('user', JSON.stringify(user))
},
setActiveMenu (state, activeMenu) {
state.activeMenu = activeMenu
@ -33,6 +28,11 @@ export const mutations = {
setUserInfo(state, data) {
state.userInfo.avatarURL = data.avatarUrl;
state.userInfo.nickname = data.nickname;
let user = {
nickname: data.nickname,
avatarURL: data.avatarUrl
}
localStorage.setItem('user', JSON.stringify(user))
}
}