fix: 修复开发模式下,首页请求两次的问题

master
Lxy 3 months ago
parent 02606aeaad
commit c8329f0d07

@ -68,7 +68,7 @@
"enabled": true,
"username": "windsdreamer",
"password": "1qazse42W3",
"pythonPort": 8001 ,
"pythonPort": 8001,
"timeout": 10000,
"retries": 10,
"maxConnections": 20

@ -21,13 +21,20 @@ const Dashboard = () => {
const [pushForm] = Form.useForm();
const [messageApi, contextHolder] = message.useMessage();
// refAPI
const fetchingRef = React.useRef(false);
useEffect(() => {
if (!fetchingRef.current) {
fetchingRef.current = true;
dispatch(fetchFuturesOverview());
dispatch(fetchRiskAlerts());
dispatch(fetchAIMarketAnalysis());
}
}, [dispatch]);
const handleRefresh = () => {
fetchingRef.current = false;
dispatch(fetchFuturesOverview());
dispatch(fetchRiskAlerts());
dispatch(fetchAIMarketAnalysis());

Loading…
Cancel
Save