修复温度曲线图 DEB 路径不显示:后端 v2 API 的 timeseries.hourly 映射到前端 CityDetail.hourly
- normalizeCityDetailPayload 新增 timeseries.hourly → hourly 字段提升 - 预热列表 DEFAULT_CITIES 扩展到 33 城,覆盖全部机场推送城市
This commit is contained in:
@@ -109,6 +109,12 @@ function buildFallbackCityDetail(name: string, depth: string, summary: Record<st
|
||||
function normalizeCityDetailPayload(data: unknown) {
|
||||
if (!data || typeof data !== "object") return data;
|
||||
const payload = data as Record<string, any>;
|
||||
|
||||
// Backend v2 nests hourly under timeseries; chart expects it at top level.
|
||||
if (!payload.hourly && payload.timeseries?.hourly) {
|
||||
payload.hourly = payload.timeseries.hourly;
|
||||
}
|
||||
|
||||
if (!payload.market_scan && payload.market_scan_payload) {
|
||||
return {
|
||||
...payload,
|
||||
|
||||
Reference in New Issue
Block a user