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,