axios-miniprogram/README.md

68 lines
3.5 KiB
Markdown
Raw Normal View History

2023-03-23 20:09:00 +08:00
# axios-miniprogram
2023-04-13 20:11:43 +08:00
<p style="display: flex;margin-left:-5px;">
<a href="https://github.com/zjx0905/axios-miniprogram/actions/workflows/ci.yml">
<img src="https://github.com/zjx0905/axios-miniprogram/actions/workflows/ci.yml/badge.svg" alt="ci">
2023-04-12 17:36:05 +08:00
</a>
2023-04-13 20:11:43 +08:00
<a style="margin-left:5px;" href="https://www.npmjs.org/package/axios-miniprogram">
<img src="https://img.shields.io/npm/v/axios-miniprogram" alt="npm">
</a>
<a style="margin-left:5px;" href="https://codecov.io/gh/zjx0905/axios-miniprogram" >
<img src="https://codecov.io/gh/zjx0905/axios-miniprogram/branch/main/graph/badge.svg?token=WIQVYX2WIK" alt="codecov"/>
</a>
<a style="margin-left:5px;" href="https://www.npmjs.org/package/axios-miniprogram">
<img src="https://img.shields.io/bundlephobia/min/axios-miniprogram" alt="npm bundle size">
</a>
<a style="margin-left:5px;" href="https://opensource.org/licenses/MIT">
<img src="https://img.shields.io/github/license/zjx0905/axios-miniprogram" alt="license">
2023-04-12 17:36:05 +08:00
</a>
</p>
2023-03-23 20:09:00 +08:00
2023-03-27 21:29:14 +08:00
[中文文档](https://axios-miniprogram.com)
2023-03-25 16:22:01 +08:00
2023-04-15 16:21:54 +08:00
## axios-miniprogram 是什么?
2023-03-23 20:09:00 +08:00
2023-04-15 12:20:09 +08:00
axios-miniprogram 是一款为小程序平台量身定制的轻量级请求库,支持跨平台使用,同时也支持多种导入方式,可用于原生小程序项目,也可用于第三方框架项目,用法上同 [axios](https://github.com/axios/axios.git) 类似。
2023-04-07 22:07:13 +08:00
## 特性
2023-03-23 20:09:00 +08:00
- 支持 `Typescript`,健全的类型系统,智能的 `IDE` 提示。
- 支持 `Promise`
2023-04-19 21:36:06 +08:00
- 支持 动态地址。
- 支持 校验状态码。
- 支持 参数序列化。
2023-04-15 12:20:09 +08:00
- 支持 上传/下载。
2023-04-19 21:36:06 +08:00
- 支持 错误处理。
- 支持 转换数据。
- 支持 取消请求。
- 支持 拦截器。
2023-04-15 12:20:09 +08:00
- 支持 派生领域。
2023-04-19 21:36:06 +08:00
- 支持 适配器。
2023-04-07 22:07:13 +08:00
2023-04-15 12:20:09 +08:00
## 目前内部支持的平台
2023-04-07 22:07:13 +08:00
- [微信小程序](https://developers.weixin.qq.com/miniprogram/dev/framework/?from=axios-miniprogram)
- [支付宝小程序](https://opendocs.alipay.com/mini/developer/getting-started?from=axios-miniprogram)
- [百度小程序](https://smartprogram.baidu.com/developer/index.html?from=axios-miniprogram)
- [京东小程序](https://mp.jd.com?from=axios-miniprogram)
2023-04-14 16:38:25 +08:00
- [抖音小程序](https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/introduction/overview?from=axios-miniprogram)
2023-04-07 22:07:13 +08:00
- [QQ 小程序](https://q.qq.com/wiki/develop/miniprogram/frame/?from=axios-miniprogram)
- [钉钉小程序](https://open.dingtalk.com/document/org/develop-org-mini-programs?from=axios-miniprogram)
- [飞书小程序](https://open.feishu.cn/document/uYjL24iN/uMjNzUjLzYzM14yM2MTN?from=axios-miniprogram)
2023-04-16 00:01:40 +08:00
- [快手小程序](https://mp.kuaishou.com/docs/introduction/quickStart.html?from=axios-miniprogram)
- [360 小程序](https://mp.360.cn/doc/miniprogram/dev/#/f4b41f0cc5683bce78dfadfa7f3c73e7?from=axios-miniprogram)
2023-04-07 22:07:13 +08:00
## 关于在跨端框架中使用时的支持度
问:在 uni-app 或者 Taro 等等这类跨端框架中使用时,该请求库支持 h5APPvue3react 等等吗?
答:该请求库只是对框架提供的请求 API 进行了封装,并没有使用什么黑魔法。理论上来讲,框架支持的平台,该库也必然支持。
有问题欢迎反馈,请尽量把问题提到 [github issues](https://github.com/zjx0905/axios-miniprogram/issues) 中,这样更容易被我注意到。
2023-04-07 20:38:29 +08:00
2023-04-07 22:07:13 +08:00
[提问点这里](https://github.com/zjx0905/axios-miniprogram/issues)
2023-04-16 00:01:40 +08:00
## 未来计划
2023-04-17 19:50:32 +08:00
2023 年 6 月 1 日 起该库将不再内部支持第三方框架,内置的 uni-app 即将移除,您依旧可以使用[适配器](https://axios-miniprogram.com/advanced/adapter)兼容 uni-app。