diff --git a/src/hooks/useWatchlist.js b/src/hooks/useWatchlist.js index d9c83941..5de2b175 100644 --- a/src/hooks/useWatchlist.js +++ b/src/hooks/useWatchlist.js @@ -64,7 +64,7 @@ export const useWatchlist = () => { const handleAddToWatchlist = useCallback(async (stockCode, stockName) => { try { const base = getApiBase(); - const resp = await fetch(base + '/api/account/watchlist/add', { + const resp = await fetch(base + '/api/account/watchlist', { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, diff --git a/src/mocks/handlers/account.js b/src/mocks/handlers/account.js index 2e4d46c8..a415b318 100644 --- a/src/mocks/handlers/account.js +++ b/src/mocks/handlers/account.js @@ -159,7 +159,7 @@ export const accountHandlers = [ }), // 6. 添加自选股 - http.post('/api/account/watchlist/add', async ({ request }) => { + http.post('/api/account/watchlist', async ({ request }) => { await delay(NETWORK_DELAY); const currentUser = getCurrentUser();