From 8a627b34a1bd45f435729c3ee43018fd2dcbee71 Mon Sep 17 00:00:00 2001 From: ymq Date: Fri, 4 Sep 2026 19:36:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(rag-client):=20dapi=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=80=BC=E7=B1=BB=E5=9E=8B=E5=8A=A0=E5=9B=BA(=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E5=8F=AF=E8=83=BD=E8=BF=94=E5=9B=9E=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_service/rag_client.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pipeline_service/rag_client.py b/pipeline_service/rag_client.py index f79886f..97330b7 100644 --- a/pipeline_service/rag_client.py +++ b/pipeline_service/rag_client.py @@ -153,9 +153,10 @@ async def get_owner_apikey(owner_id): except Exception as e: return "", "dapi 发 key 失败: " + str(e)[:200] await sor.sqlExe("COMMIT", {}) - if not res or res.get("status") != "success" or not res.get("apikey"): - return "", "dapi 发 key 失败: " + str(res or {}).get("message", "未知错误") - key = res["apikey"] + if not isinstance(res, dict) or res.get("status") != "success" or not res.get("apikey"): + _msg = res.get("message") if isinstance(res, dict) else str(res)[:120] + return "", "dapi 发 key 失败: " + str(_msg or "未知错误") + key = res["apikey"] if isinstance(res, dict) else "" # RC4 加密存 params(与平台密码字段约定一致) pname = _KEY_PARAM_PREFIX + str(owner_id) enc = _key_encode(key)