Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问useRequest是否没有办法做统一的请求/响应拦截? #16

Closed
ihwf opened this issue Jan 19, 2022 · 1 comment
Closed

请问useRequest是否没有办法做统一的请求/响应拦截? #16

ihwf opened this issue Jan 19, 2022 · 1 comment
Labels
question Further information is requested

Comments

@ihwf
Copy link

ihwf commented Jan 19, 2022

useRequest是否没有办法做统一的请求/响应拦截?

有没有办法实现类似 axios 的 interceptors ? 实现统一在请求前进行参数的修改或者请求后的错误处理?

@ihwf ihwf added the question Further information is requested label Jan 19, 2022
@innocces
Copy link
Owner

useRequest在在未自定义service的情况下是直接使用Taro.request的。所以可以直接使用taro提供的拦截器。或者自定义service: 就可以完全自定义当前请求实例的行为了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants