修复配网时城市输入乱码的问题

This commit is contained in:
2026-02-02 08:14:35 +08:00
parent e0177bc005
commit 21c7f3f990
4 changed files with 294 additions and 319 deletions

View File

@@ -139,6 +139,7 @@ async def lcd_set(request):
elif k == "ui_type":
display.ui_type = v
config.set(k, v)
config.write()
except Exception as e:
ack["status"] = "error"
ack["message"] = str(e)
@@ -212,7 +213,7 @@ async def fetch_weather_data(city=None):
# 从配置文件获取城市,如果没有提供则使用配置中的值
if not city:
city = config.get("city") or "北京"
city = config.get("cityid") or "北京"
print(f"正在获取{city}天气数据...")
# 从配置获取API基础URL默认使用官方API