@@ -1094,32 +1094,6 @@ 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=xxx,body 为 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):
|
||||
|
||||
Reference in New Issue
Block a user