CreatePlatformNonchatClientOptions
非聊天客户端的平台地址、令牌来源与可选刷新策略。
baseUrl
Section titled “baseUrl”baseUrl: string;fetchImpl?
Section titled “fetchImpl?”optional fetchImpl?: any;serve 可注入既有 refreshingFetch;此时不要再配 onUnauthorized,避免两层重铸。
onUnauthorized?
Section titled “onUnauthorized?”optional onUnauthorized?: (context) => Promise<string | void>;仅令牌失效白名单 401 调用一次;返回本次同身份的新令牌,可同时更新 getter。void 不授权跨来源重放。
context
Section titled “context”reason
Section titled “reason”string
signal
Section titled “signal”AbortSignal
Promise<string | void>
token: AppTokenSource;本文是否有帮助?
感谢反馈,我们会持续改进这篇文章。