Skip to content

[Need Help] 错误重试最后一次错误怎么在全局进行拦截 #143

Open
@fzred

Description

@fzred

问题描述 Problem Description

请求出现错误正常应该是在最后一次进行错误提示。

Axios 有请求错误拦截,但无法区分是否是错误重试的最后一次。除了在每个 useRequest 去捕获错误之外,有没有全局拦截到错误的办法?
如果暂时没办法实现,我提个建议,在 Service 请求函数传入一个参数,标识是否是重试请求或请求重试最后一次之类的。谢谢

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions