Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TigerHee/taro-request
对Taro.request进行封装
https://github.com/TigerHee/taro-request
taro taro-request
Last synced: 5 days ago
JSON representation
对Taro.request进行封装
- Host: GitHub
- URL: https://github.com/TigerHee/taro-request
- Owner: TigerHee
- Created: 2019-05-24T02:37:45.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-02T02:23:04.000Z (almost 5 years ago)
- Last Synced: 2024-08-02T18:42:10.329Z (3 months ago)
- Topics: taro, taro-request
- Language: JavaScript
- Size: 17.6 KB
- Stars: 250
- Watchers: 5
- Forks: 28
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-taro - 封装 Taro.request(拦截器,url 配置等)
README
## taro-request
> 封装Taro.request(拦截器,url配置,Authorization等),如果觉得有用的话,來个star🤝。> ✅ 仅适用于taro项目
### 目录结构
```js
servers
├── http.js // Taro.request处理
├── baseUrl.js // 设置不同环境不同路径请求的url地址
├── config.js // http状态配置
├── interceptors.js // 拦截器
├── servers.js // 建议所有接口请求整理在一起再按需引用
└── utils.js // 页面跳转等函数封装
```
### 组件内使用eg:```js
import { getResultData_servers } from '@src/servers/servers'getResultData_servers(params).then(res => {
console.log(res)
}).catch(err => {
console.log(err)
})```
### 示例项目:
* 💯[taro-init](https://github.com/TigerHee/taro-init)