unauthorizedRetry property
会话过期时自动 UnauthorizedRetryConfig.refreshAccessToken 并重试(在 send 内部完成,业务无感)。
与 on401Unauthorized / 全局 onFailure 的协调:
- 刷新成功并重试后若
isSuccess,不会进入错误回调。 - 若 UnauthorizedRetryConfig.refreshAccessToken 返回
false且已调用 UnauthorizedRetryConfig.onRefreshFailed, 则本次不会再派发 on401Unauthorized 与全局 onFailure(与「未授权形态」一致时),避免重复处理。 - 未走刷新(如 path 在 UnauthorizedRetryConfig.excludedPathPrefixes 内)的 401,仍按原逻辑走 on401Unauthorized 等。
Implementation
final UnauthorizedRetryConfig? unauthorizedRetry;