diff --git a/app/services/notify_dispatch.py b/app/services/notify_dispatch.py index 7e18dea..c06b204 100644 --- a/app/services/notify_dispatch.py +++ b/app/services/notify_dispatch.py @@ -107,10 +107,13 @@ async def process_alarm_notification(alarm_data: Dict): logger.info(f"企微未启用,跳过通知: {alarm_id}") return - event_time_str = ( - event_time.strftime("%Y-%m-%d %H:%M:%S") - if isinstance(event_time, datetime) else str(event_time or "") - ) + # 通知显示时间:只显示 MM-DD HH:MM(不含年份和秒) + if isinstance(event_time, datetime): + event_time_str = event_time.strftime("%m-%d %H:%M") + else: + # 字符串格式 "2026-03-19 10:54:24" → "03-19 10:54" + s = str(event_time or "") + event_time_str = s[5:16] if len(s) >= 16 else s user_ids = [p["wechat_uid"] for p in persons] group_chat_id = settings.wechat.group_chat_id