From ea67e1fc71102ed0eb2928f8fd66622bb8008f3c Mon Sep 17 00:00:00 2001 From: liuwei Date: Tue, 10 Jun 2025 15:40:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BC=96=E8=BE=91=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/dashboard/blueprints/message_push.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/admin/dashboard/blueprints/message_push.py b/admin/dashboard/blueprints/message_push.py index 245c3b3..7fbeaeb 100644 --- a/admin/dashboard/blueprints/message_push.py +++ b/admin/dashboard/blueprints/message_push.py @@ -186,6 +186,21 @@ def update_task(task_id): # 确保 preview_recipients 是 JSON 字符串 if 'preview_recipients' in data and isinstance(data['preview_recipients'], list): data['preview_recipients'] = json.dumps(data['preview_recipients']) + + # 转换时间格式 + if 'created_at' in data: + try: + date = datetime.strptime(data['created_at'], '%a, %d %b %Y %H:%M:%S GMT') + data['created_at'] = date.strftime('%Y-%m-%d %H:%M:%S') + except ValueError: + pass + + if 'updated_at' in data: + try: + date = datetime.strptime(data['updated_at'], '%a, %d %b %Y %H:%M:%S GMT') + data['updated_at'] = date.strftime('%Y-%m-%d %H:%M:%S') + except ValueError: + pass # 更新任务 db.update_task(task_id, data)