Browse Source
真机调用(PR 环境): POST https://test.omniselling.com.cn/saas-service/openapi/microService/oauth/token {"client_id":"openapi-test","client_secret":"123456"} → HTTP 200 {"access_token":"0dabff46-...","token_type":"bearer","scope":"server"} 文档与实际不符的两处,已按实测调整: 1. 响应是**扁平结构**,没有 code、没有 data 包裹。 原来强制要求 code,会把成功当失败。改为:缺 code 不算失败, 交给「有没有 access_token」判断;显式给了非 200 的 code 才判失败。 2. 响应**没有有效期字段**(文档说「永久,建议留窗口刷新」),也没有 refresh_token。expiresAt 改为明确的估算值语义:让 TokenManager 定期 重登一次,不是真的到期。 DTO 补了顶层 access_token / token_type / scope,data 保留为兼容分支。 探针 EdayunTokenProbeTest 实跑结果:token 取到(脱敏输出)、 tokenType=bearer、剩 7200 秒、refreshToken=null。 测试 13 个(新增 acceptsFlatShapeWithoutCode 固化实测形态; missingCodeIsRejected 改为 missingCodeWithoutTokenIsRejected, 报「no access token」而不是「no code」)。 全量 535 个测试通过。 Co-Authored-By: Claude <noreply@anthropic.com>master
4 changed files with 106 additions and 29 deletions
Loading…
Reference in new issue