From 9942ab63b9a15f5170c471be4085b584f231b8ca Mon Sep 17 00:00:00 2001 From: yunyingk Date: Fri, 17 Apr 2026 09:56:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(easo):=20JWT=20=E5=93=8D=E5=BA=94=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=90=8D=E4=B8=BA=20id=20=E8=80=8C=E9=9D=9E=20value?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E7=A9=BA=E5=80=BC=E4=BF=9D=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ekb_cli/api/platform/easo_client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ekb_cli/api/platform/easo_client.py b/src/ekb_cli/api/platform/easo_client.py index 6c94234..886508b 100644 --- a/src/ekb_cli/api/platform/easo_client.py +++ b/src/ekb_cli/api/platform/easo_client.py @@ -4,7 +4,7 @@ 区别:EASO 工作流子域使用 Bearer JWT 认证,域名固定为 unity.ekuaibao.com。 Bearer JWT 通过快报主站接口换取: - GET /api/engine/realm/$EASO/actions/jwt → {"value": ""} + GET /api/engine/realm/$EASO/actions/jwt → {"id": ""} 使用方:services/platform/workflow_service 通过 get_easo_client() 获取实例, 并在 _cmd 函数中以 with 上下文管理器管理生命周期。 @@ -83,7 +83,9 @@ def get_easo_client() -> EasoClient: with get_client() as ekb: raw = ekb.get("/engine/realm/$EASO/actions/jwt") - bearer = raw.get("value", "") + bearer = raw.get("id") or raw.get("value", "") + if not bearer: + raise ApiResponseError(0, f"EASO JWT 换取失败,响应结构异常:{raw}") return EasoClient( corp_id=corp_id,