From 22d1c411d39199712ced2577493907254be0c880 Mon Sep 17 00:00:00 2001 From: linju Date: Thu, 7 Nov 2024 18:02:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E4=BF=AE=E5=A4=8Dconversa?= =?UTF-8?q?tion=5Fgrade=E4=B8=BA100=E4=B8=94customer=5Fservice=5Fuids?= =?UTF-8?q?=E6=9C=AA=E9=85=8D=E7=BD=AE=E6=97=B6=EF=BC=8C=E6=9C=AA=E6=8B=A6?= =?UTF-8?q?=E6=88=AA=E9=9D=9E=E5=A5=BD=E5=8F=8B=E9=80=9A=E8=AE=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uniCloud/cloudfunctions/uni-im-co/msg.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/uniCloud/cloudfunctions/uni-im-co/msg.js b/uniCloud/cloudfunctions/uni-im-co/msg.js index 678a3d3..7fb5508 100644 --- a/uniCloud/cloudfunctions/uni-im-co/msg.js +++ b/uniCloud/cloudfunctions/uni-im-co/msg.js @@ -290,16 +290,14 @@ async function _checkConversationGrade({ }) { // 客服模式下,如果配置的客服 id。则只能向客服发起会话 let chatToCustomerService = async () => { - const customer_service_uids = uniImConfig.config('customer_service_uids_uids') - if (customer_service_uids) { - if (typeof customer_service_uids == 'string') { - customer_service_uids = [customer_service_uids] - } - if ( - !(customer_service_uids.includes(from_uid) || customer_service_uids.includes(to_uid)) - ) { - throw new Error('非法通讯,会话双方用户 id,均不属于 uni-im-co 中配置的 customer_service_uids') - } + const customer_service_uids = uniImConfig.config('customer_service_uids') || [] + if (typeof customer_service_uids == 'string') { + customer_service_uids = [customer_service_uids] + } + if ( + !(customer_service_uids.includes(from_uid) || customer_service_uids.includes(to_uid)) + ) { + throw new Error('非法通讯,会话双方用户 id,均不属于 uni-im-co 中配置的 customer_service_uids') } return true } -- GitLab