增加斗鱼账号检测功能

This commit is contained in:
yml2213
2026-07-09 23:12:39 +08:00
parent 1f16193690
commit cd2d02c86e
16 changed files with 1206 additions and 53 deletions
+4 -2
View File
@@ -22,7 +22,7 @@ async def create_batch(
db: Session = Depends(get_db),
current: User = Depends(require_permission("login:batch")),
):
"""创建批量登录任务。"""
"""创建批量登录或账号检测任务。"""
if not req.account_ids:
raise HTTPException(status_code=400, detail="请选择账号")
@@ -41,7 +41,8 @@ async def create_batch(
valid_ids.append(aid)
if not valid_ids:
raise HTTPException(status_code=403, detail="没有可登录的账号")
action_name = "检测" if req.mode == "check" else "登录"
raise HTTPException(status_code=403, detail=f"没有可{action_name}的账号")
# 在主事件循环中创建 log_queue,传给后台线程
log_queue = asyncio.Queue()
@@ -61,6 +62,7 @@ async def create_batch(
loop=loop,
concurrency=req.concurrency,
api_strategy=req.api_strategy,
mode=req.mode,
)
batch_id = runner.batch_id