提交 42904d28 编写于 作者: crlfe's avatar crlfe 😲

Update websocket.md

上级 c7c77cb9
......@@ -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
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册