diff --git a/src/views/TopList/TopList.vue b/src/views/TopList/TopList.vue index f379fc1..bd4b171 100644 --- a/src/views/TopList/TopList.vue +++ b/src/views/TopList/TopList.vue @@ -1056,13 +1056,21 @@ const getAllTopOne = async () => { //获取用户信息 const getUserInfo = async () => { - if (Object.keys(userInfo.value).length === 0) { - const resUserInfo = await getMemberProfile() - if (resUserInfo.status && resUserInfo.body) { - userInfo.value = resUserInfo.body + try { + if (Object.keys(userInfo.value).length === 0) { + const resUserInfo = await getMemberProfile() + console.log('resUserInfo:', resUserInfo) + + if (resUserInfo.status && resUserInfo.body) { + userInfo.value = resUserInfo.body + } } + getMyContribution() // 获取我的贡献 + } catch (error) { + console.error('Failed to fetch get user:', error) + console.error('error:' + error.response.errorMsg) + throw error } - getMyContribution() // 获取我的贡献 } // 关闭弹窗