fix(settings): 修复备份数据库时 pathlib.Path 与 fastapi.Path 命名冲突

This commit is contained in:
cnlimiter
2026-03-20 13:49:17 +08:00
parent 1bce26c81a
commit 9ada1f6ec6

View File

@@ -290,8 +290,8 @@ async def backup_database():
raise HTTPException(status_code=404, detail="数据库文件不存在")
# 创建备份目录
from fastapi import Path
backup_dir = Path(db_path).parent / "backups"
from pathlib import Path as FilePath
backup_dir = FilePath(db_path).parent / "backups"
backup_dir.mkdir(exist_ok=True)
# 生成备份文件名