优化新建会话逻辑
This commit is contained in:
@@ -725,7 +725,10 @@ import { openFile as openFileNative, downloadAndOpen } from '@/utils/fileOpener.
|
||||
return
|
||||
}
|
||||
closeNewChatModal();
|
||||
takeUserConversations();
|
||||
await takeUserConversations();
|
||||
// 切换到新创建的会话
|
||||
currentSessionId.value = conversationId;
|
||||
uni.setStorageSync('currentSessionId', conversationId);
|
||||
|
||||
} catch (error) {
|
||||
// ❌ 统一捕获异步错误,防止崩溃
|
||||
@@ -785,8 +788,9 @@ import { openFile as openFileNative, downloadAndOpen } from '@/utils/fileOpener.
|
||||
}
|
||||
// 刷新会话列表
|
||||
await takeUserConversations()
|
||||
// 切换到新创建的会话
|
||||
// 切换到新创建的会话并持久化
|
||||
currentSessionId.value = result.conversation_id
|
||||
uni.setStorageSync('currentSessionId', result.conversation_id)
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: `已创建「${result.title || agent.title}」会话`, icon: 'success' })
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user