提交 22d1c411 编写于 作者: DCloud_JSON's avatar DCloud_JSON

更新 修复conversation_grade为100且customer_service_uids未配置时,未拦截非好友通讯

上级 3cebee12
...@@ -290,16 +290,14 @@ async function _checkConversationGrade({ ...@@ -290,16 +290,14 @@ async function _checkConversationGrade({
}) { }) {
// 客服模式下,如果配置的客服 id。则只能向客服发起会话 // 客服模式下,如果配置的客服 id。则只能向客服发起会话
let chatToCustomerService = async () => { let chatToCustomerService = async () => {
const customer_service_uids = uniImConfig.config('customer_service_uids_uids') const customer_service_uids = uniImConfig.config('customer_service_uids') || []
if (customer_service_uids) { if (typeof customer_service_uids == 'string') {
if (typeof customer_service_uids == 'string') { customer_service_uids = [customer_service_uids]
customer_service_uids = [customer_service_uids] }
} if (
if ( !(customer_service_uids.includes(from_uid) || customer_service_uids.includes(to_uid))
!(customer_service_uids.includes(from_uid) || customer_service_uids.includes(to_uid)) ) {
) { throw new Error('非法通讯,会话双方用户 id,均不属于 uni-im-co 中配置的 customer_service_uids')
throw new Error('非法通讯,会话双方用户 id,均不属于 uni-im-co 中配置的 customer_service_uids')
}
} }
return true return true
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册