diff --git a/backend/services/eastmoney.py b/backend/services/eastmoney.py index 6271215..8fdcbd4 100644 --- a/backend/services/eastmoney.py +++ b/backend/services/eastmoney.py @@ -1074,7 +1074,20 @@ async def fetch_fund_flow_daykline(code: str, days: int) -> Optional[list[dict]] continue return None result = resp.json() - klines = result.get("data", {}).get("klines", []) + if not isinstance(result, dict): + if attempt == 0: + continue + return None + if result.get("rc", -1) != 0: + if attempt == 0: + continue + return None + data = result.get("data") + if not data or not isinstance(data, dict): + if attempt == 0: + continue + return None + klines = data.get("klines", []) if not klines: if attempt == 0: continue