fix: update backup export to use JSON mode

This commit is contained in:
shiyu
2026-02-09 15:26:48 +08:00
parent c456a208de
commit c473251926
2 changed files with 12 additions and 4 deletions

View File

@@ -28,7 +28,7 @@ async def export_backup(
data = await BackupService.export_data(sections=sections)
timestamp = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
headers = {"Content-Disposition": f"attachment; filename=foxel_backup_{timestamp}.json"}
return JSONResponse(content=data.model_dump(), headers=headers)
return JSONResponse(content=data.model_dump(mode="json"), headers=headers)
@router.post("/import", summary="导入数据")