diff --git a/core/frontend/src/App.tsx b/core/frontend/src/App.tsx index 24efecb..937d59a 100644 --- a/core/frontend/src/App.tsx +++ b/core/frontend/src/App.tsx @@ -228,14 +228,18 @@ export function App() { if (cancelled || !identity) return; setUser(identity.user); setTeam(identity.team); - await loadDataWithRetry(); } catch (bootError) { - console.error("[boot] failed:", bootError); + // 仅「身份校验失败」才登出;me() 成功后的数据加载失败不在此处 + console.error("[boot] identity failed:", bootError); setToken(null); if (!cancelled) setAuthed(false); - } finally { if (!cancelled) setBooting(false); + return; } + // ★ 身份就绪即渲染外壳,不等全局数据 —— 商品/项目/余额/未读 后台并行填充,页面骨架先出来。 + if (!cancelled) setBooting(false); + // 全局数据后台加载;失败只记录(token 已验证有效,不踢登录、不阻塞渲染) + loadDataWithRetry().catch((dataError) => console.error("[boot] data load failed:", dataError)); })(); return () => { cancelled = true;