双端适配,web端的修改父容器和接口

This commit is contained in:
2026-03-29 02:34:13 +08:00
parent 3c071957ce
commit ebb0c003e3
16 changed files with 1419 additions and 226 deletions

View File

@@ -332,8 +332,22 @@ class MessageService {
page: data.page || 1,
page_size: data.page_size || 20,
};
} catch (error) {
console.error('获取消息列表失败:', error);
} catch (error: any) {
// 检查是否是权限错误或会话不存在错误 - 这是正常情况,不需要打印错误日志
const errorMessage = error?.message || String(error);
if (
errorMessage.includes('not found') ||
errorMessage.includes('no permission') ||
error?.code === 'NOT_FOUND' ||
error?.code === 'FORBIDDEN'
) {
// 会话不存在或无权限访问,返回空消息列表
// 这可能是因为会话已被删除、用户被踢出群聊等情况
console.warn('[MessageService] 会话不存在或无权限访问:', conversationId);
} else {
// 其他错误才打印错误日志
console.error('[MessageService] 获取消息列表失败:', error);
}
return {
messages: [],
total: 0,