diff --git a/src/components/Header.vue b/src/components/Header.vue index f738f53..2ebf747 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -6,7 +6,7 @@
- + {{userName}}
@@ -19,7 +19,6 @@ export default { data() { return { - avatar: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png', userName: '' }; }, @@ -30,7 +29,7 @@ export default { getUserInfo(){ this.$get(this.api.queryUserInfoDetails).then(res => { let userInfo = res.result.hrUserInfo - if(userInfo.userAvatars) this.avatar = userInfo.userAvatars + if(userInfo.userAvatars) this.$store.commit('userAvatar',{avatar: userInfo.userAvatars}) this.userName = userInfo.userName }).catch(err => {}) }, diff --git a/src/views/setting/Person.vue b/src/views/setting/Person.vue index d1dcb6e..4397c04 100644 --- a/src/views/setting/Person.vue +++ b/src/views/setting/Person.vue @@ -567,7 +567,7 @@ export default { //取得头像地址 getRes(res) { this.avatar = res.message - this.$store.commit('userPhoto',{avatar:res.message}) + this.$store.commit('userAvatar',{avatar:res.message}) }, getdata() { this.$get(this.api.queryUserInfoDetails).then(res => {