update watchlist

This commit is contained in:
2025-12-16 08:25:19 +08:00
parent 804ca77c1b
commit 3d1057fd04
3 changed files with 8 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ import { useState, useCallback } from 'react';
import type { Dispatch, SetStateAction, KeyboardEvent } from 'react';
import axios from 'axios';
import { MessageTypes, type Message } from '../constants/messageTypes';
import { getApiBase } from '@utils/apiConfig';
import type { UploadedFile } from './useFileUpload';
import type { User } from './useAgentSessions';
@@ -161,7 +162,7 @@ export const useAgentChat = ({
});
// 调用后端 API
const response = await axios.post('/mcp/agent/chat', {
const response = await axios.post(`${getApiBase()}/mcp/agent/chat`, {
message: userInput,
conversation_history: messages
.filter((m) => m.type === MessageTypes.USER || m.type === MessageTypes.AGENT_RESPONSE)

View File

@@ -5,6 +5,7 @@ import { useState, useEffect, useCallback } from 'react';
import type { Dispatch, SetStateAction } from 'react';
import axios from 'axios';
import { MessageTypes, type Message } from '../constants/messageTypes';
import { getApiBase } from '@utils/apiConfig';
/**
* 会话数据结构
@@ -94,7 +95,7 @@ export const useAgentSessions = ({
setIsLoadingSessions(true);
try {
const response = await axios.get('/mcp/agent/sessions', {
const response = await axios.get(`${getApiBase()}/mcp/agent/sessions`, {
params: { user_id: String(user.id), limit: 50 },
});
@@ -133,7 +134,7 @@ export const useAgentSessions = ({
if (!sessionId) return;
try {
const response = await axios.get(`/mcp/agent/history/${sessionId}`, {
const response = await axios.get(`${getApiBase()}/mcp/agent/history/${sessionId}`, {
params: { limit: 100 },
});

View File

@@ -4,6 +4,7 @@
import { useState, useCallback, useRef } from 'react';
import axios from 'axios';
import { getApiBase } from '@utils/apiConfig';
import {
MeetingMessage,
MeetingStatus,
@@ -265,7 +266,7 @@ export const useInvestmentMeeting = ({
try {
// 使用 fetch 进行 POST 请求的 SSE
const response = await fetch('/mcp/agent/meeting/stream', {
const response = await fetch(`${getApiBase()}/mcp/agent/meeting/stream`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -483,7 +484,7 @@ export const useInvestmentMeeting = ({
}));
// 使用 fetch 进行 POST 请求的 SSE
const response = await fetch('/mcp/agent/meeting/stream', {
const response = await fetch(`${getApiBase()}/mcp/agent/meeting/stream`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',