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 ""