From a7f779d2a276ebaec2c976c8c66ff2870eb6a001 Mon Sep 17 00:00:00 2001 From: zzlgreat Date: Tue, 2 Dec 2025 17:36:35 +0800 Subject: [PATCH] update pay ui --- src/views/Dashboard/Center.js | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/views/Dashboard/Center.js b/src/views/Dashboard/Center.js index 638ccd60..dcc01902 100644 --- a/src/views/Dashboard/Center.js +++ b/src/views/Dashboard/Center.js @@ -101,19 +101,36 @@ export default function CenterDashboard() { const [quotesLoading, setQuotesLoading] = useState(false); const loadData = useCallback(async () => { - console.log('[Center] 📡 loadData 被调用', new Date().toISOString()); - console.trace('[Center] loadData 调用栈'); + console.log('[Center] 📡 loadData 开始', new Date().toISOString()); try { const base = getApiBase(); const ts = Date.now(); - const [w, e, c] = await Promise.all([ - fetch(base + `/api/account/watchlist?_=${ts}`, { credentials: 'include', cache: 'no-store', headers: { 'Cache-Control': 'no-cache' } }), - fetch(base + `/api/account/events/following?_=${ts}`, { credentials: 'include', cache: 'no-store', headers: { 'Cache-Control': 'no-cache' } }), - fetch(base + `/api/account/events/posts?_=${ts}`, { credentials: 'include', cache: 'no-store', headers: { 'Cache-Control': 'no-cache' } }), - ]); + + console.log('[Center] 🌐 开始请求 API...', base); + + // 分开请求,方便定位哪个 API 卡住 + console.time('[Center] API: watchlist'); + const w = await fetch(base + `/api/account/watchlist?_=${ts}`, { credentials: 'include', cache: 'no-store', headers: { 'Cache-Control': 'no-cache' } }); + console.timeEnd('[Center] API: watchlist'); + console.log('[Center] ✅ watchlist 响应状态:', w.status); + + console.time('[Center] API: events/following'); + const e = await fetch(base + `/api/account/events/following?_=${ts}`, { credentials: 'include', cache: 'no-store', headers: { 'Cache-Control': 'no-cache' } }); + console.timeEnd('[Center] API: events/following'); + console.log('[Center] ✅ events/following 响应状态:', e.status); + + console.time('[Center] API: events/posts'); + const c = await fetch(base + `/api/account/events/posts?_=${ts}`, { credentials: 'include', cache: 'no-store', headers: { 'Cache-Control': 'no-cache' } }); + console.timeEnd('[Center] API: events/posts'); + console.log('[Center] ✅ events/posts 响应状态:', c.status); + + console.log('[Center] 📥 开始解析 JSON...'); const jw = await w.json(); + console.log('[Center] ✅ watchlist JSON 解析完成'); const je = await e.json(); + console.log('[Center] ✅ events/following JSON 解析完成'); const jc = await c.json(); + console.log('[Center] ✅ events/posts JSON 解析完成'); if (jw.success) { const watchlistData = Array.isArray(jw.data) ? jw.data : []; setWatchlist(watchlistData);