diff --git a/pages/user/settings/account.vue b/pages/user/settings/account.vue index ca5868c..07a34d4 100644 --- a/pages/user/settings/account.vue +++ b/pages/user/settings/account.vue @@ -195,7 +195,7 @@ _ts.$set(_ts, 'user', res.user); _ts.$set(_ts, 'avatarUrl', res.user.avatarUrl); _ts.$set(_ts, 'svgShow', false); - // _ts.$store.commit('setUserInfo', res.user); + _ts.$store.commit('setUserInfo', res.user); _ts.$message.success('更新成功 !'); } } diff --git a/store/index.js b/store/index.js index bb1dc4a..09886e5 100644 --- a/store/index.js +++ b/store/index.js @@ -18,6 +18,10 @@ export const mutations = { }, setUploadHeaders(state, data){ state.uploadHeaders = data + }, + setUserInfo(state, data) { + state.oauth.avatarURL = data.avatarUrl; + state.oauth.nickname = data.nickname; } }