diff --git a/src/pages/ai/chat.vue b/src/pages/ai/chat.vue index b22e1f5..f56c46a 100644 --- a/src/pages/ai/chat.vue +++ b/src/pages/ai/chat.vue @@ -1259,6 +1259,22 @@ onLoad(async (op) => { // 获取历史记录 getHistoryMessages(1) + + // 每次进入页面都新插入一条开场白信息 + setTimeout(() => { + if (quickQuestionsData.value.length > 0) { + const welcomeMessage: Message = { + role: 'ai', + content: '您好!我是物业客服,有什么可以帮助您的吗?', + quickQuestions: quickQuestionsData.value, + created_at: new Date().toISOString() + } + messages.value.unshift(welcomeMessage) + console.log('[Customer] 每次进入页面都插入开场白消息') + scrollToBottom() + } + }, 100) + if(op?.message){ handleQuickAction(op as QuickAction) }