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:
@@ -2,6 +2,7 @@
|
||||
|
||||
from logging.config import fileConfig
|
||||
from pathlib import Path
|
||||
import os
|
||||
import sys
|
||||
|
||||
from alembic import context
|
||||
@@ -17,7 +18,10 @@ from web.backend import models # noqa: F401,E402
|
||||
config = context.config
|
||||
config.set_main_option("sqlalchemy.url", DATABASE_URL)
|
||||
|
||||
if config.config_file_name is not None:
|
||||
# 仅在独立运行 alembic CLI 时配置 logging;应用进程内(如 uvicorn 启动调用
|
||||
# run_migrations)跳过 fileConfig,避免它覆盖 uvicorn 已配置的日志处理器,
|
||||
# 否则会导致 "Application startup complete" 等启动日志无法输出。
|
||||
if config.config_file_name is not None and not os.getenv("ALEMBIC_EMBEDDED"):
|
||||
fileConfig(config.config_file_name)
|
||||
|
||||
target_metadata = Base.metadata
|
||||
|
||||
Reference in New Issue
Block a user