From 2a0960c2510ee74b979b6e6a47a487b8f8f0a63e Mon Sep 17 00:00:00 2001 From: Sakurasan <26715255+Sakurasan@users.noreply.github.com> Date: Fri, 24 Jul 2026 18:19:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=A4=E4=B8=AA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 移除 eastmoney K线接口的 parsed.reverse(),统一为升序返回(与其他数据源一致), 修复 K线图时间方向相反、每日行情明细展示远期数据的 bug 2. fetch_fund_flow_daykline 改用 curl_cffi 替代 httpx,匹配东方财富 push2his 的 TLS 指纹检测,修复主力资金流向数据获取不到的 bug Co-Authored-By: Claude --- backend/services/eastmoney.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/services/eastmoney.py b/backend/services/eastmoney.py index 4cc623d..6271215 100644 --- a/backend/services/eastmoney.py +++ b/backend/services/eastmoney.py @@ -1035,7 +1035,6 @@ async def fetch_kline_history(code: str, days: int = 90) -> Optional[list[dict]] "turnoverRate": _f(10), }) - parsed.reverse() return parsed except Exception as e: if attempt == 0: @@ -1064,10 +1063,12 @@ async def fetch_fund_flow_daykline(code: str, days: int) -> Optional[list[dict]] "Referer": "https://quote.eastmoney.com/", } + from curl_cffi.requests import AsyncSession + for attempt in range(2): - async with httpx.AsyncClient() as client: + async with AsyncSession(impersonate="chrome120") as session: try: - resp = await client.get(url, headers=headers, timeout=10) + resp = await session.get(url, headers=headers, timeout=10) if resp.status_code != 200: if attempt == 0: continue