diff --git a/yunkes/src/api/index.ts b/yunkes/src/api/index.ts index 906fd26..77bf4d8 100644 --- a/yunkes/src/api/index.ts +++ b/yunkes/src/api/index.ts @@ -15,6 +15,7 @@ import type { Message, Page, PhoneCall, + SessionList, Sms, Staff, StaffChatStats, @@ -238,6 +239,22 @@ export function getStaffChatStats(query: StaffChatStatsQuery): Promise { + return getJson( + '/sessions', + clean({ owner_account_id: query.owner_account_id, channel: query.channel }), + ) +} + // --------------------------------------------------------------------------- // Sync monitor // --------------------------------------------------------------------------- @@ -300,6 +317,7 @@ export type { Message, Page, PhoneCall, + SessionList, Sms, Staff, StaffChatStats, diff --git a/yunkes/src/api/types.ts b/yunkes/src/api/types.ts index 026fd32..05dfdd2 100644 --- a/yunkes/src/api/types.ts +++ b/yunkes/src/api/types.ts @@ -277,3 +277,21 @@ export interface StaffChatStats { summary: StaffChatStatsSummary customers: StaffChatCustomer[] } + +/** 账号会话列表一行(好友或群),镜像 backend SessionOut。 */ +export interface ChatSession { + type: 'friend' | 'group' + talker_id?: string | null + room_id?: string | null + name?: string | null + avatar?: string | null + today_count: number + last_chat_time?: number | null +} + +export interface SessionList { + owner_account_id: string + channel: string + today_start: number + sessions: ChatSession[] +} diff --git a/yunkes/src/components/ChatSidebar.vue b/yunkes/src/components/ChatSidebar.vue new file mode 100644 index 0000000..cb85f1b --- /dev/null +++ b/yunkes/src/components/ChatSidebar.vue @@ -0,0 +1,96 @@ + + + + +