We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
No description provided.
The text was updated successfully, but these errors were encountered:
如何使用axios
Sorry, something went wrong.
现在 useAPI 是基于 fetch 类请求库封装的,fetcher 类型是: (url: string, options?: RequestInit) => Promise<any> 如果需要基于 axios,可以基于 useAsync 自己封装,方式上面可以参考 https://github.com/umijs/hooks/blob/master/src/useAPI/index.ts
(url: string, options?: RequestInit) => Promise<any>
useApi, 如果请求返回的是undefined 会提示错误,需要添加 对res的判断 async () => { const res = await requestMethod(opt.url, opt.options); return res && res.json && typeof res.json === 'function' ? res.json() : res; },
async () => { const res = await requestMethod(opt.url, opt.options); return res && res.json && typeof res.json === 'function' ? res.json() : res; },
ttys026
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: