diff --git a/uniCloud/cloudfunctions/uni-im-co/conversation.js b/uniCloud/cloudfunctions/uni-im-co/conversation.js index 6a9af90734ae7c490c8b43dd1892b7a17e002c92..358c25bd8c50ec67b9ebd8f091ae144b1c053a4b 100644 --- a/uniCloud/cloudfunctions/uni-im-co/conversation.js +++ b/uniCloud/cloudfunctions/uni-im-co/conversation.js @@ -209,11 +209,14 @@ async function getConversationList({ let friend_uids = res.data.map(item => item.friend_uid).filter(i => i) // 计算请求时间 startTime = Date.now() - let usersInfoRes = await dbJQL.collection('uni-id-users') - .where(`_id in ${JSON.stringify(friend_uids)}`) - .field('_id,avatar_file,nickname,realname_auth') - .limit(friend_uids.length) - .get() + let usersInfoRes = {data:[]} + if (friend_uids.length !== 0){ + usersInfoRes = await dbJQL.collection('uni-id-users') + .where(`_id in ${JSON.stringify(friend_uids)}`) + .field('_id,avatar_file,nickname,realname_auth') + .limit(friend_uids.length) + .get() + } // log请求时间 // console.error('get user耗时', Date.now() - startTime,startTime)