1234567891011121314151617181920212223242526272829 |
- let http = {
- get(url, data, {
- header,
- // showLoading = true,
- timeout = 20000
- } = {}) {
- let promise = new Promise(function(resolve, reject) {
- uni.request({
- url: url,
- method: 'GET',
- data,
- timeout,
- }).then(
- (res) => {
- resolve(res[1])
- }
- ).catch(
- )
- })
- return promise;
- }
- }
- export default http;
|