2991692032 1 week ago
parent 9cc5739e58
commit fd4135c249

@ -271,16 +271,25 @@ const startNewChat = async () => {
try {
// ID
const newSessionId = `session_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`
await createChatSession(newSessionId, '新对话')
//
currentChatId.value = newSessionId
currentMessages.value = []
//
await createChatSession(newSessionId, '新对话')
//
await loadChatHistory()
//
await scrollToBottom()
ElMessage.success('新对话已创建')
} catch (error: any) {
console.error('创建新会话失败:', error)
ElMessage.error('创建新会话失败')
// 使
}
}

@ -62,8 +62,7 @@ public class AiServiceImpl implements AiService {
public Result<AiSessionListVO> getSessionList(Integer page, Integer size) {
log.info("获取会话列表: page={}, size={}", page, size);
// 使用会话历史服务获取会话列表(支持匿名会话)
return sessionHistoryService.getSessionList(null, page, size);
return sessionHistoryService.getSessionList(BaseContext.getId(), page, size);
}
@Override

Loading…
Cancel
Save