diff --git a/backend/service_implementation/service/data/futures_analysis.db b/backend/service_implementation/service/data/futures_analysis.db index 31a3045..3fb3941 100644 Binary files a/backend/service_implementation/service/data/futures_analysis.db and b/backend/service_implementation/service/data/futures_analysis.db differ diff --git a/config.json b/config.json index 8920097..e19bd93 100644 --- a/config.json +++ b/config.json @@ -68,7 +68,7 @@ "enabled": true, "username": "windsdreamer", "password": "1qazse42W3", - "pythonPort": 8001 , + "pythonPort": 8001, "timeout": 10000, "retries": 10, "maxConnections": 20 diff --git a/src/pages/dashboard/Dashboard.jsx b/src/pages/dashboard/Dashboard.jsx index 0016746..bd177a0 100644 --- a/src/pages/dashboard/Dashboard.jsx +++ b/src/pages/dashboard/Dashboard.jsx @@ -20,14 +20,21 @@ const Dashboard = () => { const [currentFuture, setCurrentFuture] = useState(null); const [pushForm] = Form.useForm(); const [messageApi, contextHolder] = message.useMessage(); + + // 添加ref来避免在开发模式下的重复API请求 + const fetchingRef = React.useRef(false); useEffect(() => { - dispatch(fetchFuturesOverview()); - dispatch(fetchRiskAlerts()); - dispatch(fetchAIMarketAnalysis()); + if (!fetchingRef.current) { + fetchingRef.current = true; + dispatch(fetchFuturesOverview()); + dispatch(fetchRiskAlerts()); + dispatch(fetchAIMarketAnalysis()); + } }, [dispatch]); const handleRefresh = () => { + fetchingRef.current = false; dispatch(fetchFuturesOverview()); dispatch(fetchRiskAlerts()); dispatch(fetchAIMarketAnalysis());