From 4f375c3d710a9b5548e15fe989a510ea217f292e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Sat, 22 Aug 2026 16:50:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(chat):=20=E7=BE=A4=E8=81=8A=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=9F=A5=E8=AF=A2=E4=B8=8D=E5=B8=A6owner(chat=5Fgroup?= =?UTF-8?q?=E6=8C=89room=E5=8E=BB=E9=87=8Downer=E8=A2=AB=E6=9C=AB=E4=BD=8D?= =?UTF-8?q?=E5=91=98=E5=B7=A5=E8=A6=86=E7=9B=96,=E4=B8=8E=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E5=BD=92=E5=B1=9E=E9=94=99=E4=BD=8D=E6=9F=A5=E7=A9=BA?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit room 全局唯一且消息只在单一owner名下(多owner群=0),按room查即正确; MessageQuery.owner_account_id 改可选。实测43304群6000条正常显示。 16个活跃群0条消息=增量未覆盖,4h调度自动补 Co-Authored-By: Claude --- yunkes/src/api/index.ts | 3 ++- yunkes/src/views/ChatTimeline.vue | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/yunkes/src/api/index.ts b/yunkes/src/api/index.ts index 9045666..29dad02 100644 --- a/yunkes/src/api/index.ts +++ b/yunkes/src/api/index.ts @@ -76,7 +76,8 @@ export function getCustomers(query: CustomerQuery = {}): Promise> export interface MessageQuery { channel?: Channel - owner_account_id: string + /** 群聊按 room_id 查时可省略(chat_group owner 与消息 owner 可能错位)。 */ + owner_account_id?: string talker_id?: string room_id?: string start?: number diff --git a/yunkes/src/views/ChatTimeline.vue b/yunkes/src/views/ChatTimeline.vue index 039ced4..12c9699 100644 --- a/yunkes/src/views/ChatTimeline.vue +++ b/yunkes/src/views/ChatTimeline.vue @@ -170,11 +170,13 @@ function scrollToBottom(): void { function queryFor(pageNum: number) { return { channel: channelTyped.value, - owner_account_id: props.ownerId, - talker_id: isGroup.value ? undefined : props.talkerId, - room_id: isGroup.value ? props.roomId : undefined, - start: winStart.value, - end: winEnd.value, + // 群聊不带 owner:chat_group 表按 room_id 去重、owner 被最后写入的员工 + // 覆盖,与消息实际归属的 owner 错位会查空(实测 2026-08-22);room 全局 + // 唯一且消息只在单一 owner 名下(多 owner 群=0),按 room 查即正确。 + ...(isGroup.value + ? { room_id: props.roomId as string } + : { owner_account_id: props.ownerId, talker_id: props.talkerId as string }), + ...(winStart.value != null && winEnd.value != null ? { start: winStart.value, end: winEnd.value } : {}), page: pageNum, page_size: PAGE_SIZE, }