fix: 修复斗鱼Cookie导出422路由冲突 & 优化登录密码错误提示

- cookies.py: 将 GET /export 路由移至 GET /{task_id} 之前,避免
  动态路径 task_id:int 误匹配 'export' 导致 422 校验错误
- LoginPage.tsx: 密码错误(401)时清空密码框并自动聚焦,方便快速重试
- database.py/migrations/env.py: 应用内嵌调用 alembic 时跳过 fileConfig,
  避免覆盖 uvicorn 日志配置导致启动日志丢失
- client.ts: 401 拦截排除 /auth/login,避免登录失败时误跳转吞掉错误提示
This commit is contained in:
yml2213
2026-07-30 13:04:40 +08:00
parent 8de269f958
commit 72cf0e5fef
5 changed files with 58 additions and 38 deletions
+6 -1
View File
@@ -106,7 +106,12 @@ def run_migrations():
config = Config(str(PROJECT_ROOT / "alembic.ini"))
config.set_main_option("script_location", str(PROJECT_ROOT / "web" / "backend" / "migrations"))
config.set_main_option("sqlalchemy.url", DATABASE_URL)
command.upgrade(config, "head")
# 标记为应用内嵌调用,env.py 据此跳过 fileConfig,避免覆盖 uvicorn 日志配置。
os.environ["ALEMBIC_EMBEDDED"] = "1"
try:
command.upgrade(config, "head")
finally:
os.environ.pop("ALEMBIC_EMBEDDED", None)
def _seed():