From a01dbdf5740c989e584e166d1dbc912ee5bfc13e Mon Sep 17 00:00:00 2001 From: zyh Date: Sun, 29 Mar 2026 23:19:12 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E5=8F=91=E9=80=81=20API=20=E4=BD=BF=E7=94=A8=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用正确的环信 SDK 4.x 消息创建 API (message.create) - 修复消息类型参数,使用 'txt' 代替 messageType.TXT - 测试验证双用户消息互发功能正常工作 Co-Authored-By: Claude Co-Authored-By: Happy --- scripts/test-easemob-msg.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/test-easemob-msg.js b/scripts/test-easemob-msg.js index ac35882..55c8013 100644 --- a/scripts/test-easemob-msg.js +++ b/scripts/test-easemob-msg.js @@ -88,11 +88,11 @@ function createConnection(account, websdk, appConfig) { // ────────────────────────────────────────── function sendTextMessage(conn, websdk, to, text, label, stats) { try { - const message = new websdk.message({ + const message = websdk.message.create({ + type: 'txt', to, - type: 'chat', - msg: text, chatType: 'singleChat', + msg: text, }); const result = conn.send(message); // conn.send 可能返回 Promise