From b1b2d78aa38828d37de4b7b2f2d2e92cb6a5c7f0 Mon Sep 17 00:00:00 2001 From: 16337 <1633794139@qq.com> Date: Thu, 19 Mar 2026 14:36:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=9C=B0=E5=9D=80=E7=8B=AC=E7=AB=8B=E4=BA=8E?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E9=85=8D=E7=BD=AE=EF=BC=8C=E6=94=AF=E6=8C=81?= =?UTF-8?q?=20IOT=5FPLATFORM=5FURL=20=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 区域名称查询不再依赖 WORK_ORDER_BASE_URL, 优先使用 IOT_PLATFORM_URL,降级用工单地址。 --- app/services/notify_dispatch.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/services/notify_dispatch.py b/app/services/notify_dispatch.py index 0c3c32c..aff103e 100644 --- a/app/services/notify_dispatch.py +++ b/app/services/notify_dispatch.py @@ -12,6 +12,7 @@ VLM 或企微不可用时自动降级,不影响系统运行。 """ +import os from datetime import datetime from typing import Dict, List @@ -309,7 +310,11 @@ async def _get_area_name_from_iot(area_id: int) -> str: try: import httpx import time - base_url = settings.work_order.base_url + # IoT 平台地址(区域查询),优先级:IOT_PLATFORM_URL > WORK_ORDER_BASE_URL + base_url = ( + os.getenv("IOT_PLATFORM_URL", "") + or settings.work_order.base_url + ) if not base_url: return ""