🐛 更新头像与昵称后刷新界面,头像缓存问题修复
This commit is contained in:
parent
b4498c2550
commit
3a65bf3b0b
@ -18,11 +18,6 @@ export const mutations = {
|
|||||||
},
|
},
|
||||||
setUser (state, data) {
|
setUser (state, data) {
|
||||||
state.userInfo = data
|
state.userInfo = data
|
||||||
let user = {
|
|
||||||
nickname: data.nickname,
|
|
||||||
avatarURL: data.avatarUrl
|
|
||||||
}
|
|
||||||
localStorage.setItem('user', JSON.stringify(user))
|
|
||||||
},
|
},
|
||||||
setActiveMenu (state, activeMenu) {
|
setActiveMenu (state, activeMenu) {
|
||||||
state.activeMenu = activeMenu
|
state.activeMenu = activeMenu
|
||||||
@ -33,6 +28,11 @@ export const mutations = {
|
|||||||
setUserInfo(state, data) {
|
setUserInfo(state, data) {
|
||||||
state.userInfo.avatarURL = data.avatarUrl;
|
state.userInfo.avatarURL = data.avatarUrl;
|
||||||
state.userInfo.nickname = data.nickname;
|
state.userInfo.nickname = data.nickname;
|
||||||
|
let user = {
|
||||||
|
nickname: data.nickname,
|
||||||
|
avatarURL: data.avatarUrl
|
||||||
|
}
|
||||||
|
localStorage.setItem('user', JSON.stringify(user))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user