diff --git a/uniCloud/database/uni-im-group-join.schema.ext.js b/uniCloud/database/uni-im-group-join.schema.ext.js index 2fc5054ba0bcdc40b78a6d8e1808bc27c1c7d3ab..93c8c8215086892f726ccad30be590257c618e59 100644 --- a/uniCloud/database/uni-im-group-join.schema.ext.js +++ b/uniCloud/database/uni-im-group-join.schema.ext.js @@ -55,10 +55,13 @@ module.exports = { throw new Error(res.errMsg) } } - // 5. 判断用户是否已经绑定手机号 - let res3 = await db.collection('uni-id-users').where({_id:userInfo.uid}).get() - if(!res3.data[0].mobile_confirmed){ - throw new Error('你的账号未绑定手机号,不能加入群聊') + // 5. 判断用户是否已经绑定手机号,系统管理员除外 + console.log('userInfo',userInfo); + if(!userInfo.role.includes('uni-im-admin') && !userInfo.role.includes('staff')){ + let res3 = await db.collection('uni-id-users').where({_id:userInfo.uid}).get() + if(!res3.data[0].mobile_confirmed){ + throw new Error('你的账号未绑定手机号,不能加入群聊') + } } } else { throw new Error('非法参数')