From 9acec97257fd376c3c68806a401f0409a9b65661 Mon Sep 17 00:00:00 2001 From: DLmaster361 Date: Fri, 15 Aug 2025 16:43:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=97=B6=E9=97=B4=E6=96=87=E6=9C=AC=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/core/config.py | 12 ++++++------ app/models/schema.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/core/config.py b/app/core/config.py index 0acbed2..5162934 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -1182,9 +1182,9 @@ class AppConfig(GlobalConfig): overview = {} for user, data in history_data.items(): last_proxy_date = max( - datetime.strptime(_["date"], "%d日 %H:%M:%S") + datetime.strptime(_["date"], "%Y年%m月%d日 %H:%M:%S") for _ in data.get("index", []) - ).strftime("%d日 %H:%M:%S") + ).strftime("%Y年%m月%d日 %H:%M:%S") proxy_times = len(data.get("index", [])) error_info = data.get("error_info", {}) error_times = len(error_info) @@ -1642,12 +1642,12 @@ class AppConfig(GlobalConfig): if single_data[key] != "Success!": if "error_info" not in data: data["error_info"] = {} - data["error_info"][actual_date.strftime("%d日 %H:%M:%S")] = ( - single_data[key] - ) + data["error_info"][ + actual_date.strftime("%Y年%m月%d日 %H:%M:%S") + ] = single_data[key] data["index"][actual_date] = { - "date": actual_date.strftime("%d日 %H:%M:%S"), + "date": actual_date.strftime("%Y年%m月%d日 %H:%M:%S"), "status": ( "完成" if single_data[key] == "Success!" else "异常" ), diff --git a/app/models/schema.py b/app/models/schema.py index a3e9e5e..e7bf0d4 100644 --- a/app/models/schema.py +++ b/app/models/schema.py @@ -663,7 +663,7 @@ class TaskMessage(BaseModel): class HistorySearchIn(BaseModel): - mode: Literal["按日合并", "按周合并", "按年月并"] = Field( + mode: Literal["按日合并", "按周合并", "按月合并"] = Field( ..., description="合并模式" ) start_date: str = Field(..., description="开始日期, 格式YYYY-MM-DD")