From a85cba463afc431acb4b963348e249ed7916bfd8 Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期日, 19 一月 2025 11:52:46 +0800
Subject: [PATCH] chat_start message notification

---
 src/components/chat/hooks/useSyncMsg.ts |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/components/chat/hooks/useSyncMsg.ts b/src/components/chat/hooks/useSyncMsg.ts
index 8a17e9c..1bcbf4f 100644
--- a/src/components/chat/hooks/useSyncMsg.ts
+++ b/src/components/chat/hooks/useSyncMsg.ts
@@ -4,6 +4,8 @@
 import { RoleEnum, type ChatMessage } from '../model/types';
 import { QueryHistoryDetail } from '/@/api/ai/chat';
 import { sseClient } from '/@/stores/global';
+import { Logger } from '/@/model/logger/Logger';
+import { ElNotification } from 'element-plus';
 
 type UseSyncMsgOptions = {
 	updateLoadIndex: (addCount: number) => void;
@@ -42,7 +44,17 @@
 	const historyUpdate = async (data: any) => {
 		if (!checkCanSync(data)) return;
 		if (!data) return;
+		Logger.info('sync message notification锛歕n\n' + JSON.stringify(data));
 
+		if (data?.type === 'chat_start') {
+			const fromTitle = data?.from || '鏈煡绔�';
+			ElNotification({
+				title: fromTitle,
+				message: `姝e湪澶勭悊鏂扮殑鎻愰棶锛岃鑰愬績绛夊緟锛屽璇濆畬鎴愬悗浼氳嚜鍔ㄥ悓姝,
+				type: 'info',
+				duration: 4000,
+			});
+		}
 		if (data?.type === 'chat_history_id') {
 			const groupId = unref(historyGroupId);
 			if (!groupId) return;

--
Gitblit v1.9.3