From e5575c96a03f3bc870f004427bd9c43e693f20d3 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Mon, 25 May 2026 07:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20DEB=20=E9=A2=84=E6=8A=A5?= =?UTF-8?q?=E6=9B=B2=E7=BA=BF=E5=9B=A0=20API=20=E7=BB=93=E6=9E=84=E4=B8=8D?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E8=80=8C=E6=B0=B8=E4=B8=8D=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit P0: detail?depth=panel 返回 timeseries.hourly 嵌套结构,图表原来直接读 json.hourly 始终 undefined。改为 json.hourly ?? json.timeseries?.hourly fallback。models_hourly 同理。 --- .../scan-terminal/LiveTemperatureThresholdChart.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/components/dashboard/scan-terminal/LiveTemperatureThresholdChart.tsx b/frontend/components/dashboard/scan-terminal/LiveTemperatureThresholdChart.tsx index 1c7bdf8f..982de188 100644 --- a/frontend/components/dashboard/scan-terminal/LiveTemperatureThresholdChart.tsx +++ b/frontend/components/dashboard/scan-terminal/LiveTemperatureThresholdChart.tsx @@ -344,13 +344,14 @@ export function LiveTemperatureThresholdChart({ return res.json() as Promise; }) .then((json) => { - if (cancelled || !json?.hourly) return; + const hourlySource = (json as any)?.hourly ?? (json as any)?.timeseries?.hourly; + if (cancelled || !json || !hourlySource) return; const data: HourlyForecast = { forecastTodayHigh: json.forecast?.today_high ?? null, localTime: json.local_time || null, - times: json.hourly.times || [], - temps: json.hourly.temps || [], - modelCurves: json.models_hourly?.curves || undefined, + times: hourlySource.times || [], + temps: hourlySource.temps || [], + modelCurves: (json.models_hourly ?? (json as any)?.timeseries?.models_hourly)?.curves || undefined, }; _hourlyCache.set(city, { ts: Date.now(), data }); setHourly(data);