fix: 修复搜索历史为空时的展示问题

- 在搜索历史 API 调用失败时,确保返回非空数组
- 避免在搜索建议列表为空时出现错误或异常
This commit is contained in:
jmal 2025-06-04 14:02:13 +08:00
parent d46b630841
commit 227d952112

View File

@ -4683,6 +4683,7 @@ export default {
cb(this.searchSuggestions)
}).catch(error => {
console.error("Error fetching search history:", error)
cb(this.searchSuggestions.length > 0 ? this.searchSuggestions : [])
})
},
handleSelectSuggestion(item) {