Commit 66fcfcbd by Liu

fix:历史记录没有question时,不展示空白对话框

parent 9d73c1d5
...@@ -5,10 +5,13 @@ export function processApiResponse(data: OriginalRecord[]): ChatRecord[] { ...@@ -5,10 +5,13 @@ export function processApiResponse(data: OriginalRecord[]): ChatRecord[] {
if (data.length === 0) if (data.length === 0)
return chatRecord return chatRecord
data.forEach((record) => { data.forEach((record) => {
chatRecord.push({ // 如果没有 question 字段(后端未返回问题文案),则不生成用户问题气泡,避免展示“空气炮”
role: 'user', if (record.question) {
...record, chatRecord.push({
}) role: 'user',
...record,
})
}
if (record.answerList && record.answerList.length > 0) { if (record.answerList && record.answerList.length > 0) {
record.answerList.forEach((answer) => { record.answerList.forEach((answer) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment