po3a  

学习TypeScript 和 WebSockets,处理 WebSocket 消息。 WebSocket 是一种实时通信协议,用于在客户端和服务器之间建立双向通信。

学习如何在客户端使用 WebSocket 进行连接、发送和接收消息。

 // 修改阅读状态

  store.socket.on("changMsgstatus", (data: any) => {

    store.conversitionList.map((x: Conversition) => {

      if (x.timestamp != null && x.timestamp == data.timestamp) {

        x.status = 1

      }

    })

  })

 

  // 加入会话成功

  store.socket.on("joinSuccess", (data: any) => {

    store.userInfo && (store.userInfo.onlineStatus = true)

    store.conversitionList = data.conversition

    store.sessionList = data.historySessionList

  })

posted on 2024-05-19 23:37  po3a  阅读(9)  评论(0)    收藏  举报