From b40856237665ab2b4e57df9a76bc6d71d19fa204 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Wed, 23 Oct 2024 15:50:17 +0800 Subject: [PATCH] fix --- src/api/index.js | 6 + src/layouts/header/index.vue | 16 +- src/layouts/home/index.vue | 31 +- src/pages/account/login/index.vue | 35 +- src/pages/setting/list/index.vue | 557 ++++++++++++++++++++++++------ src/pages/setting/list/info.vue | 475 ------------------------- src/plugins/requests/index.js | 23 +- src/router/permission.js | 9 +- src/setting.js | 1 + src/store/modules/user.js | 19 +- 10 files changed, 527 insertions(+), 645 deletions(-) delete mode 100644 src/pages/setting/list/info.vue 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 @@