From 94d84a368f94587a78ede49715ec978453274733 Mon Sep 17 00:00:00 2001 From: Sakurasan <26715255+Sakurasan@users.noreply.github.com> Date: Mon, 13 Jul 2026 22:44:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E6=8D=A2=E6=9D=BF=E5=9D=97=20tab=20?= =?UTF-8?q?=E6=97=B6=E5=BC=BA=E5=88=B6=20refetch=EF=BC=8C=E7=BB=95?= =?UTF-8?q?=E8=BF=87=E5=89=8D=E7=AB=AF/=E5=8F=8D=E4=BB=A3=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E7=A1=AE=E4=BF=9D=E6=95=B0=E6=8D=AE=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/sectors.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/routes/sectors.tsx b/src/routes/sectors.tsx index 9dfafae..bf738e5 100644 --- a/src/routes/sectors.tsx +++ b/src/routes/sectors.tsx @@ -40,6 +40,12 @@ function SectorsPage() { const { data = [], isLoading, isFetching, refetch } = tab === "industry" ? industryQ : conceptQ; + // 切换 tab 时强制重新请求,绕过 React Query 缓存和上游反代缓存,确保拿到对应类型的数据 + const handleTab = (t: SectorType) => { + setTab(t); + (t === "industry" ? industryQ : conceptQ).refetch(); + }; + const sorted = useMemo(() => { const dir = asc ? 1 : -1; return [...data].sort((a, b) => { @@ -83,7 +89,7 @@ function SectorsPage() { {TABS.map((t) => (