From f4a0869af52d287ba918096d0106db1319345cad Mon Sep 17 00:00:00 2001 From: AskaEth Date: Sun, 26 Jul 2026 21:16:16 +0800 Subject: [PATCH] fix: market auth error handling, identity field forwarding --- server/api.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/api.py b/server/api.py index 1d44489..036162d 100644 --- a/server/api.py +++ b/server/api.py @@ -512,11 +512,12 @@ async def api_market_auth(data: dict): async with httpx.AsyncClient(timeout=10) as client: resp = await client.post( f"{url}/api/collections/users/auth-with-password", - json={"identity": data.get("email"), "password": data.get("password")} + json={"identity": data.get("email", data.get("identity","")), "password": data.get("password")} ) - return resp.json() + result = resp.json() + return result except Exception as e: - return {"error": str(e)} + return {"message": "服务器连接失败: " + str(e), "token": None} @router.post("/market/register")