| | |
| | | // uni.showLoading({ |
| | | // title:"加载中..." |
| | | // }) |
| | | uni.showLoading({ |
| | | title: '加载中', |
| | | mask: true |
| | | }) |
| | | // uni.showLoading({ |
| | | // title: '加载中', |
| | | // mask: true |
| | | // }) |
| | | const param = uni.getStorageSync('param') || {} |
| | | uni.request({ |
| | | url: (param.baseUrl || baseUrl) + options.url, |
| | | // url: baseUrl + options.url, |
| | | data: options.data || {}, |
| | | method: options.method || 'GET', |
| | | header: options.header || { |
| | |
| | | success: (res) => { |
| | | let data = res.data |
| | | // 控制台显示数据信息 |
| | | uni.hideLoading() |
| | | // uni.hideLoading() |
| | | // 登录过期 |
| | | if (data.code === 5112) { |
| | | setTimeout(() => { |
| | |
| | | console.log('msg', baseUrl + options.url) |
| | | // 返回错误消息 |
| | | reject(err) |
| | | uni.hideLoading() |
| | | // uni.hideLoading() |
| | | }, |
| | | catch: (e) => { |
| | | console.log(e) |