update watchlist
This commit is contained in:
@@ -5,6 +5,7 @@ import { useState, useCallback } from 'react';
|
|||||||
import type { Dispatch, SetStateAction, KeyboardEvent } from 'react';
|
import type { Dispatch, SetStateAction, KeyboardEvent } from 'react';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { MessageTypes, type Message } from '../constants/messageTypes';
|
import { MessageTypes, type Message } from '../constants/messageTypes';
|
||||||
|
import { getApiBase } from '@utils/apiConfig';
|
||||||
import type { UploadedFile } from './useFileUpload';
|
import type { UploadedFile } from './useFileUpload';
|
||||||
import type { User } from './useAgentSessions';
|
import type { User } from './useAgentSessions';
|
||||||
|
|
||||||
@@ -161,7 +162,7 @@ export const useAgentChat = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 调用后端 API
|
// 调用后端 API
|
||||||
const response = await axios.post('/mcp/agent/chat', {
|
const response = await axios.post(`${getApiBase()}/mcp/agent/chat`, {
|
||||||
message: userInput,
|
message: userInput,
|
||||||
conversation_history: messages
|
conversation_history: messages
|
||||||
.filter((m) => m.type === MessageTypes.USER || m.type === MessageTypes.AGENT_RESPONSE)
|
.filter((m) => m.type === MessageTypes.USER || m.type === MessageTypes.AGENT_RESPONSE)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { useState, useEffect, useCallback } from 'react';
|
|||||||
import type { Dispatch, SetStateAction } from 'react';
|
import type { Dispatch, SetStateAction } from 'react';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { MessageTypes, type Message } from '../constants/messageTypes';
|
import { MessageTypes, type Message } from '../constants/messageTypes';
|
||||||
|
import { getApiBase } from '@utils/apiConfig';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会话数据结构
|
* 会话数据结构
|
||||||
@@ -94,7 +95,7 @@ export const useAgentSessions = ({
|
|||||||
|
|
||||||
setIsLoadingSessions(true);
|
setIsLoadingSessions(true);
|
||||||
try {
|
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 },
|
params: { user_id: String(user.id), limit: 50 },
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -133,7 +134,7 @@ export const useAgentSessions = ({
|
|||||||
if (!sessionId) return;
|
if (!sessionId) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(`/mcp/agent/history/${sessionId}`, {
|
const response = await axios.get(`${getApiBase()}/mcp/agent/history/${sessionId}`, {
|
||||||
params: { limit: 100 },
|
params: { limit: 100 },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
import { useState, useCallback, useRef } from 'react';
|
import { useState, useCallback, useRef } from 'react';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import { getApiBase } from '@utils/apiConfig';
|
||||||
import {
|
import {
|
||||||
MeetingMessage,
|
MeetingMessage,
|
||||||
MeetingStatus,
|
MeetingStatus,
|
||||||
@@ -265,7 +266,7 @@ export const useInvestmentMeeting = ({
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// 使用 fetch 进行 POST 请求的 SSE
|
// 使用 fetch 进行 POST 请求的 SSE
|
||||||
const response = await fetch('/mcp/agent/meeting/stream', {
|
const response = await fetch(`${getApiBase()}/mcp/agent/meeting/stream`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
@@ -483,7 +484,7 @@ export const useInvestmentMeeting = ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
// 使用 fetch 进行 POST 请求的 SSE
|
// 使用 fetch 进行 POST 请求的 SSE
|
||||||
const response = await fetch('/mcp/agent/meeting/stream', {
|
const response = await fetch(`${getApiBase()}/mcp/agent/meeting/stream`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|||||||
Reference in New Issue
Block a user