对话接口修正
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
import { api } from '@/apis/index';
|
||||
import { API_BASE_URL } from '@/config';
|
||||
import type {
|
||||
AiConversation,
|
||||
AiMessage,
|
||||
@@ -49,7 +50,7 @@ export const chatApi = {
|
||||
|
||||
// 第2步:GET建立SSE连接
|
||||
const eventSource = new EventSource(
|
||||
`/api/ai/chat/stream?sessionId=${sessionId}&token=${tokenData}`
|
||||
`${API_BASE_URL}/ai/chat/stream?sessionId=${sessionId}&token=${tokenData}`
|
||||
);
|
||||
|
||||
// 通知外部EventSource已创建
|
||||
@@ -304,9 +305,9 @@ export const chatApi = {
|
||||
const tokenData = token ? JSON.parse(token) : null;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
// 使用相对路径走Vite代理,SSE流式推送
|
||||
// 使用配置的baseURL,SSE流式推送
|
||||
const eventSource = new EventSource(
|
||||
`/api/ai/chat/regenerate/${messageId}?` +
|
||||
`${API_BASE_URL}/ai/chat/regenerate/${messageId}?` +
|
||||
new URLSearchParams({
|
||||
token: tokenData?.value || ''
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user