Skip to content

Commit 9ada1f6

Browse files
committed
fix(settings): 修复备份数据库时 pathlib.Path 与 fastapi.Path 命名冲突
1 parent 1bce26c commit 9ada1f6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/web/routes/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ async def backup_database():
290290
raise HTTPException(status_code=404, detail="数据库文件不存在")
291291

292292
# 创建备份目录
293-
from fastapi import Path
294-
backup_dir = Path(db_path).parent / "backups"
293+
from pathlib import Path as FilePath
294+
backup_dir = FilePath(db_path).parent / "backups"
295295
backup_dir.mkdir(exist_ok=True)
296296

297297
# 生成备份文件名

0 commit comments

Comments
 (0)