Merge branch 'ai-hub' into ai-hub-dev

This commit is contained in:
ccnetcore
2025-07-18 20:46:36 +08:00
4 changed files with 6 additions and 8 deletions

View File

@@ -2,7 +2,7 @@ import type { ChatMessageVo, GetChatListParams, SendDTO } from './types';
import { get, post } from '@/utils/request';
// 发送消息
export const send = (data: SendDTO) => post<null>('/ai-chat/send', data);
export const send = (data: SendDTO) => post<null>(`/ai-chat/send/${data.sessionId}`, data);
// 新增对应会话聊天记录
export function addChat(data: ChatMessageVo) {

View File

@@ -49,6 +49,7 @@ export interface SendDTO {
* 是否携带上下文
*/
usingContext?: boolean;
}
/**

View File

@@ -188,14 +188,10 @@ async function startSSE(chatContent: string) {
? `${item.content.substring(0, 2000)}...(内容过长,已省略)`
: item.content,
})),
// sessionId: route.params?.id !== 'not_login' ? String(route.params?.id) : undefined,
// userId: userStore.userInfo?.userId,
// model: modelStore.currentModelInfo.modelId ?? '',
sessionId: route.query?.sessionId !== 'not_login' ? String(route.query?.sessionId) : undefined, // 修改点sessionId 从 query 参数中获取
sessionId: route.params?.id !== 'not_login' ? String(route.params?.id) : undefined,
stream: true,
userId: userStore.userInfo?.userId,
model: modelStore.currentModelInfo.modelId ?? '', // 修改点modelId 改为 model
model: modelStore.currentModelInfo.modelId ?? '',
})) {
handleDataChunk(chunk.result as AnyObject);
}

View File

@@ -6,6 +6,7 @@ interface ImportMetaEnv {
readonly VITE_WEB_ENV: string;
readonly VITE_WEB_BASE_API: string;
readonly VITE_API_URL: string;
readonly VITE_BUILD_COMPRESS: string;
readonly VITE_SSO_SEVER_URL: string;
readonly VITE_APP_VERSION: string;
}