diff --git a/backend/instance/cookie_monitor.db b/backend/instance/cookie_monitor.db index 94b3c04..636403e 100644 Binary files a/backend/instance/cookie_monitor.db and b/backend/instance/cookie_monitor.db differ diff --git a/backend/routes/detections.py b/backend/routes/detections.py index db12cce..8f439b5 100644 --- a/backend/routes/detections.py +++ b/backend/routes/detections.py @@ -70,6 +70,12 @@ def get_detection(detection_id): # 为Detection模型添加to_dict方法 def detection_to_dict(self): + created_at = self.created_at + if created_at: + if created_at.tzinfo is None: + from datetime import timezone + created_at = created_at.replace(tzinfo=timezone.utc) + created_at = created_at.astimezone() return { 'id': self.id, 'website_id': self.website_id, @@ -77,7 +83,7 @@ def detection_to_dict(self): 'response_time': self.response_time, 'http_status': self.http_status, 'message': self.message, - 'created_at': self.created_at.isoformat() if self.created_at else None + 'created_at': created_at.isoformat() if created_at else None } Detection.to_dict = detection_to_dict