From cb45a841d6242ff43466e21cb8c7d836c8ac971d Mon Sep 17 00:00:00 2001 From: DCloud_JSON Date: Thu, 25 Apr 2024 11:36:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E6=89=8B=E6=9C=BA=E5=8F=B7=E7=A0=81=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E5=85=A5=E7=BE=A4=E8=A7=84=E5=88=99=EF=BC=8C=E6=8E=92?= =?UTF-8?q?=E9=99=A4=E8=A7=92=E8=89=B2=E4=B8=BA=EF=BC=9Auni-im-admin?= =?UTF-8?q?=E3=80=81staff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uniCloud/database/uni-im-group-join.schema.ext.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/uniCloud/database/uni-im-group-join.schema.ext.js b/uniCloud/database/uni-im-group-join.schema.ext.js index 2fc5054..93c8c82 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('非法参数') -- GitLab