fix: 优化登录项

This commit is contained in:
丹尼尔
2026-03-15 19:17:12 +08:00
parent 9f0e2a2db2
commit 3b3fac1cee
6 changed files with 316 additions and 8 deletions

View File

@@ -1094,6 +1094,32 @@ async def api_slider_verify_post(body: SliderVerifyBody):
raise HTTPException(status_code=502, detail=f"slider_upstream_error: {e}") from e
class VerifyCodeBody(BaseModel):
"""iPad 登录验证码7006 /login/VerifyCode 入参。"""
code: str = ""
data62: str = ""
ticket: str = ""
@app.post("/api/verify-code")
async def api_verify_code(key: str = Query(..., description="账号 key"), body: VerifyCodeBody = None):
"""iPad 登录验证码验证:转发到 7006 POST /login/VerifyCode?key=xxxbody 为 code、data62、ticket。"""
if body is None:
body = VerifyCodeBody()
url = f"{CHECK_STATUS_BASE_URL.rstrip('/')}/login/VerifyCode"
payload = {"code": (body.code or "").strip(), "data62": (body.data62 or "").strip(), "ticket": (body.ticket or "").strip()}
try:
async with httpx.AsyncClient(trust_env=False, timeout=30.0) as client:
resp = await client.post(url, params={"key": key}, json=payload)
try:
return resp.json()
except Exception:
return {"ok": resp.status_code == 200, "status_code": resp.status_code, "text": (resp.text or "")[:500]}
except Exception as e:
logger.warning("VerifyCode upstream error: %s", e)
raise HTTPException(status_code=502, detail=f"verify_code_upstream_error: {e}") from e
# ---------- R1-2 客户画像 / R1-3 定时问候 / R1-4 分群推送 / 消息与发送 ----------
class CustomerCreate(BaseModel):