feat(抽奖活动页): 修复获取我的排名的问题
This commit is contained in:
parent
b82a639868
commit
00b79cdcc8
@ -1178,8 +1178,14 @@ const getUserInfo = async () => {
|
||||
if (Object.keys(userInfo.value).length === 0) {
|
||||
const resUserInfo = await getMemberProfile()
|
||||
if (resUserInfo.status && resUserInfo.body) {
|
||||
userInfo.value =
|
||||
userInfo.value == {} ? resUserInfo.body : Object.assign(userInfo.value, resUserInfo.body)
|
||||
if (ranking.value.length == 0) {
|
||||
userInfo.value = resUserInfo.body
|
||||
} else {
|
||||
// 在排行榜中查我的信息
|
||||
const myInfo = ranking.value.find((item) => item.account == resUserInfo.body.account)
|
||||
console.log('myInfo:', myInfo)
|
||||
userInfo.value = Object.assign(resUserInfo.body, myInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
const resIdentity = await getUserIdentity()
|
||||
@ -1315,12 +1321,14 @@ const getRanking = async () => {
|
||||
const resRanking = await ranklist()
|
||||
if (resRanking.status && resRanking.body) {
|
||||
ranking.value = resRanking.body
|
||||
// 在排行榜中查我的信息
|
||||
const myInfo = ranking.value.find((item) => item.account == userInfo.value.account)
|
||||
console.log('myInfo:', myInfo)
|
||||
if (Object.keys(userInfo.value).length != 0) {
|
||||
// 在排行榜中查我的信息
|
||||
const myInfo = resRanking.body.find((item) => item.account == userInfo.value.account)
|
||||
console.log('myInfo:', myInfo)
|
||||
|
||||
if (myInfo) {
|
||||
userInfo.value = userInfo.value == {} ? myInfo : Object.assign(userInfo.value, myInfo)
|
||||
if (myInfo) {
|
||||
Object.assign(userInfo.value, myInfo)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ranking.value = {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user