feat: always show welcome message regardless of history

This commit is contained in:
Your Name 2026-04-01 14:49:59 +08:00
parent 275a611381
commit a47be2c3f6

View File

@ -598,6 +598,21 @@ const getHistoryMessages = async (page: number = 1) => {
// //
console.log('没有历史记录') console.log('没有历史记录')
messages.value = [] messages.value = []
//
nextTick(() => {
if (quickQuestionsData.value.length > 0) {
const welcomeMessage: Message = {
role: 'ai',
content: '您好!我是物业客服,有什么可以帮助您的吗?',
quickQuestions: quickQuestionsData.value,
created_at: new Date().toISOString()
}
messages.value.push(welcomeMessage)
console.log('[Customer] 没有历史记录时,展示开场白消息')
scrollToBottom()
}
})
} }
// //