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
目前的 axios 封装了多个方法,使得 Ajax 变得复杂且不纯粹。
很多中后台项目都是单点登录,且单点登录类型很多。
更特别是部署时,来回切换登录方式。
需要实现多个 axios 实例拦截,登录逻辑会变得非常复杂。
防抖,节流,可见重新,错误重试等功能
消息通知类型
监听功能,缓存,复用 hooks,手动触发等
若上述多个场景都封装到 axios 实例,这就会让 ajax 请求变得非常复杂,且错误后调试非常麻烦。 特别是在对接api接口的时候。
我之前开发过 ahooks 的vue 版本的 request useRequest
文档可以参考下: https://ahooks.js.org/zh-CN/hooks/use-request/index
这个比目前封装的 axios 和 Form 下面很多API组件实用, 耦合度会降低很多
If the feature requests relates to a problem, please describe the problem you are trying to solve here.
希望改成可插拔型的 Promise 方法
What are the alternative solutions? Please describe what else you have considered?
The text was updated successfully, but these errors were encountered:
vue3 有vueuse, useaxios useasyncstate axios和useRequest不是一个东西,axios是用来请求,useRequest是异步状态管理。
Sorry, something went wrong.
没说是一个东西。为此我改了 issues 防止到时候又出现理解偏差
说的是,这个东西(uesRequest)比现在这个项目封装axios实例适用。 比如:
axios
axios 保留纯粹的 ajax 请求、响应的结构体,项目对API时利于排查问题。
resolve #3447
刚看到,我觉得还是作为npm包导入比较合适。 @luocong2016
No branches or pull requests
Subject of the feature
很多中后台项目都是单点登录,且单点登录类型很多。
更特别是部署时,来回切换登录方式。
需要实现多个 axios 实例拦截,登录逻辑会变得非常复杂。
防抖,节流,可见重新,错误重试等功能
消息通知类型
监听功能,缓存,复用 hooks,手动触发等
若上述多个场景都封装到 axios 实例,这就会让 ajax 请求变得非常复杂,且错误后调试非常麻烦。
特别是在对接api接口的时候。
推荐下状态方法管理
我之前开发过 ahooks 的vue 版本的 request
useRequest
文档可以参考下:
https://ahooks.js.org/zh-CN/hooks/use-request/index
这个比目前封装的 axios 和 Form 下面很多API组件实用, 耦合度会降低很多
Problem
If the feature requests relates to a problem, please describe the problem you are trying to solve here.
Expected behaviour
希望改成可插拔型的 Promise 方法
Alternatives
What are the alternative solutions? Please describe what else you have considered?
The text was updated successfully, but these errors were encountered: