From f4342e7c82d312c88a4c6e7f49f50e24f53a633c Mon Sep 17 00:00:00 2001 From: cc Date: Thu, 18 Jun 2026 20:35:54 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E5=A4=A9=E6=B0=94=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E6=97=B6=E4=B8=8D=E5=85=9C=E5=BA=95=E3=80=81?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 线上不设 WEATHER_DEFAULT_LOCATION:高德定位失败即返回 failed, 不再回退默认城市、也不调和风,前端静默不显示。更新文档说明。 Co-Authored-By: Claude Opus 4.8 --- docs/startpage-weather-location.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/startpage-weather-location.md b/docs/startpage-weather-location.md index c3f5ea3..44cc21c 100644 --- a/docs/startpage-weather-location.md +++ b/docs/startpage-weather-location.md @@ -48,8 +48,12 @@ > 和风认证用 **JWT(EdDSA/Ed25519)**:后端用私钥签发 15 分钟有效的 token, > 以 `Authorization: Bearer` 调用。私钥**只放后端**,绝不进前端/仓库。 -> 本地开发时访问者 IP 是 `127.0.0.1`,高德无法定位 → 建议设 `WEATHER_DEFAULT_LOCATION` + -> `WEATHER_DEFAULT_CITY` 才能在本地看到天气;部署后用访问者真实公网 IP,自动定位。 +> 定位失败的处理:高德对**数据中心 / DNS / 部分移动·CGNAT / 境外 IP** 会返回空。 +> 若**不设** `WEATHER_DEFAULT_LOCATION`,定位失败时接口直接返回 `failed` → +> **不再调和风**(省额度)→ 前端静默不显示天气。**线上有意不设兜底**,就是这个效果。 +> +> 本地开发时访问者 IP 是 `127.0.0.1`,高德无法定位 → 想在本地看到天气,可临时设 +> `WEATHER_DEFAULT_LOCATION` + `WEATHER_DEFAULT_CITY`(仅本地 `weather.env`,别带上线)。 ## 本地运行