(options)
| 4 | } from './config.js' |
| 5 | |
| 6 | function request(options) { |
| 7 | wx.showLoading({ |
| 8 | title: '数据加载中ing', |
| 9 | }) |
| 10 | |
| 11 | return new Promise((resolve, reject) => { |
| 12 | wx.request({ |
| 13 | url: baseURL + options.url, |
| 14 | timeout: timeout, |
| 15 | data: options.data, |
| 16 | success: function(res) { |
| 17 | resolve(res.data) |
| 18 | }, |
| 19 | fail: reject, |
| 20 | complete: res => { |
| 21 | wx.hideLoading() |
| 22 | } |
| 23 | }) |
| 24 | }) |
| 25 | } |
| 26 | |
| 27 | export default request; |
| 28 |
no outgoing calls
no test coverage detected