diff --git a/src/pages/purchaser/Dashboard.tsx b/src/pages/purchaser/Dashboard.tsx index d87675d..02ad8fb 100644 --- a/src/pages/purchaser/Dashboard.tsx +++ b/src/pages/purchaser/Dashboard.tsx @@ -74,7 +74,10 @@ export function PurchaserDashboard() { }, []); useEffect(() => { - if (!auth.company) return; + if (!auth.company) { + setLoading(false); + return; + } // 如果数据已加载,不再重新加载 if (dataLoaded && plans.length > 0) { setLoading(false); diff --git a/src/pages/textile/Dashboard.tsx b/src/pages/textile/Dashboard.tsx index 0bb7c38..c6d2e66 100644 --- a/src/pages/textile/Dashboard.tsx +++ b/src/pages/textile/Dashboard.tsx @@ -62,7 +62,10 @@ export function TextileDashboard() { }, []); useEffect(() => { - if (!auth.company) return; + if (!auth.company) { + setLoading(false); + return; + } fetchPlans(); // 从 localStorage 读取被拒绝的计划ID const stored = localStorage.getItem(STORAGE_KEYS.textileRejectedPlans); diff --git a/src/pages/washing/Dashboard.tsx b/src/pages/washing/Dashboard.tsx index 7d3f682..2d65295 100644 --- a/src/pages/washing/Dashboard.tsx +++ b/src/pages/washing/Dashboard.tsx @@ -69,7 +69,10 @@ export function WashingDashboard() { }, []); useEffect(() => { - if (!auth.company) return; + if (!auth.company) { + setLoading(false); + return; + } fetchPlans(); }, [auth.company]);