消息列表实现概述
一、历史聊天消息
场次历史消息
async function getSessionHistory() {
const res = await chat.getSessionHistory({
// 场次 id(非必传,默认使用实例的 sessionId)
sessionId: '',
// 页数
page: 1,
// 条数(非必传,默认10)
size: 20,
});
const { curPage, totalPage, count, size, data = [] } = res;
const isLastPage = curPage === totalPage;
console.log('场次消息列表数据:', data);
}频道历史消息
二、实时收发聊天消息
接收消息
事件名
说明
消息类型列表
msgType
消息类型
发送消息
发送文字消息
Last updated