feat: always insert new welcome message when entering chat page
This commit is contained in:
parent
b4fea7b34f
commit
39223cad85
@ -1259,6 +1259,22 @@ onLoad(async (op) => {
|
|||||||
|
|
||||||
// 获取历史记录
|
// 获取历史记录
|
||||||
getHistoryMessages(1)
|
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){
|
if(op?.message){
|
||||||
handleQuickAction(op as QuickAction)
|
handleQuickAction(op as QuickAction)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user