From 42904d2805594b76141ee3eb7141733f4fef50be Mon Sep 17 00:00:00 2001 From: crlfe Date: Tue, 25 Jun 2024 16:47:41 +0800 Subject: [PATCH] Update websocket.md --- docs/websocket.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/websocket.md b/docs/websocket.md index 6993614..8637e8b 100644 --- a/docs/websocket.md +++ b/docs/websocket.md @@ -159,7 +159,7 @@ module.exports = { ### WebSocketServer.send@uniCloud.ws.send > -> 从云函数/云对象中像客户端发送消息 +> 从云函数/云对象中向客户端发送消息 ```javascript const ws = uniCloud.webSocketServer() @@ -189,7 +189,7 @@ exports.onWebsocketMessage = async function (event) { // 发送给多个客户端 await ws.send([connectionId1, connectionId2, ...], `receive:${payload}`) - // 发送给客户端对象数据,发送时会自动JSON.stringify为字符串后发送 + // 发送给客户端对象数据,发送时会自动JSON.stringify为字符串 await ws.send(connectionId, { receive: payload }) -- GitLab