优化验证码展示
This commit is contained in:
@@ -8,6 +8,8 @@ import threading
|
||||
from datetime import UTC, datetime
|
||||
from typing import cast
|
||||
|
||||
from loguru import logger
|
||||
|
||||
from fastapi import (
|
||||
APIRouter,
|
||||
Depends,
|
||||
@@ -772,8 +774,14 @@ def app_password_login_account(
|
||||
) from exc
|
||||
|
||||
if not result.success or not result.cookie:
|
||||
logger.warning(
|
||||
f"[huya-app] 账号 {req.username} 密码登录未完成: {result.message} (code={result.code})"
|
||||
)
|
||||
raise HTTPException(
|
||||
status_code=502, detail=result.message or "虎牙 App 密码登录失败"
|
||||
status_code=400
|
||||
if result.code in ("SMS_AUTH_REQUIRED", "QR_AUTH_REQUIRED")
|
||||
else 502,
|
||||
detail=result.message or "虎牙 App 密码登录失败",
|
||||
)
|
||||
|
||||
try:
|
||||
@@ -1269,6 +1277,9 @@ def app_password_login_selected_accounts(
|
||||
account.updated_at = datetime.now(UTC)
|
||||
db.commit()
|
||||
failed_count += 1
|
||||
logger.warning(
|
||||
f"[huya-app] 账号 {username} 批量登录未完成: {result.message} (code={result.code})"
|
||||
)
|
||||
results.append(
|
||||
{
|
||||
"line": account.id,
|
||||
|
||||
Reference in New Issue
Block a user