umi icon indicating copy to clipboard operation
umi copied to clipboard

[Feature Request] 我想要能拿到这个 requestMethodInstance,方便动态添加拦截器

Open komagic opened this issue 2 years ago • 0 comments

Background

request 需要在 一个 异步请求 后 拿到id,并将id设置在 之后的每次request 请求 header 中

目前request 没有暴露axios 的instance,无法动态添加拦截器。

只能单次提交的时候自己手动添加id到header的相应字段,或者自己封装request,较为麻烦。

Proposal

我想要能拿到这个 requestMethodInstance,不封装request的前提下,以便于动态添加\注册拦截器,而不需要每次修改,而不是只能在app.ts里改。

Additional context

简而言之,我需要 request.ts 里这个 requestMethodInstance 这个东西。

komagic avatar Aug 16 '22 10:08 komagic