fix: listByConversation 在 conversation 不存在时返回空列表而非抛异常
This commit is contained in:
@@ -661,7 +661,11 @@ const continueCurrentVersion = () => {
|
||||
}
|
||||
|
||||
const loadMessages = async () => {
|
||||
if (!conversationId.value) return
|
||||
// 短路保护:conversationId 为空时不请求接口,显示友好提示
|
||||
if (!conversationId.value) {
|
||||
uni.showToast({ title: '暂无对话记录', icon: 'none' })
|
||||
return
|
||||
}
|
||||
try {
|
||||
const res = await listMessagesByConversation({ conversationId: conversationId.value, includeVersions: false })
|
||||
messages.value = res.data || []
|
||||
|
||||
Reference in New Issue
Block a user