diff --git a/src/api/index.js b/src/api/index.js index 079c819..8317ca5 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -9,6 +9,12 @@ export default { forgotPreVerification: `/users/users/user/forgotPreVerification`, sendPhoneVerificationCode: `/users/users/user/sendPhoneVerificationCode`, queryUserInfoDetails: `/users/users/userAccount/queryUserInfoDetails`, + updatePersonCenter: `/users/users/userAccount/updatePersonCenter`, + logout: `/users/users/user/logout`, + updateUserAvatars: `${host}/users/users/userAccount/updateUserAvatars`, + examinePassword: `/users/users/userAccount/examinePassword`, + bindPhoneOrEmail: `/users/users/userAccount/bindPhoneOrEmail`, + sendPhoneOrEmailCode: `/users/users/userAccount/sendPhoneOrEmailCode`, getUserRolesPermissionMenu: `/users/users/user-role/getUserRolesPermissionMenu`, getCurrentTime: `/competition/competition/management/getCurrentTime`, diff --git a/src/layouts/header/index.vue b/src/layouts/header/index.vue index 3964f38..76ae896 100644 --- a/src/layouts/header/index.vue +++ b/src/layouts/header/index.vue @@ -8,7 +8,7 @@ {{ userName }} - 个人中心 + 个人资料 退出登录 @@ -38,12 +38,22 @@ export default { ]) }, mounted () { - + this.getUserInfo() }, methods: { + ...mapMutations("user", [ + 'setAvatar', 'setUserName', 'setUserId' + ]), ...mapActions("user", [ 'logout' ]), + async getUserInfo () { + const res = await this.$get(this.api.queryUserInfoDetails) + const { userAvatars, userName } = res.result.hrUserInfo || {} + userAvatars && this.setAvatar(userAvatars) + res.result.userAccount && localStorage.setItem('reviewAID', res.result.userAccount.id) + this.setUserName(userName) + }, // 用户切换回调 userCommand (command) { if (command == 'person') { @@ -110,7 +120,7 @@ export default { .username { margin-left: 8px; - color: #333; + color: #fff; font-size: 14px; } } diff --git a/src/layouts/home/index.vue b/src/layouts/home/index.vue index 3fbc861..5b513bc 100644 --- a/src/layouts/home/index.vue +++ b/src/layouts/home/index.vue @@ -1,8 +1,8 @@