-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest.js
More file actions
31 lines (30 loc) · 929 Bytes
/
request.js
File metadata and controls
31 lines (30 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const baseURL = 'http://service-j81m89sf-1302936021.bj.apigw.tencentcs.com:80/parse'
export default (urlParam, params) => {
console.log("urlParam:", urlParam);
console.log("params:", params);
if(params.pageFrom != 'aiCreatePage' && params.pageFrom != 'taskListPage') {
uni.showLoading({
title: '加载中'
});
}
return new Promise((resolve, reject) => {
wx.request({
url: baseURL + urlParam,
...params,
header: {
'X-Parse-Application-Id': 'BTGAPPId',
'X-Parse-REST-API-Key': 'BTGAPIKEY',
'content-type': 'application/json'
},
success(res) {
resolve(res.data);
},
fail(err) {
reject(err);
},
complete() {
uni.hideLoading();
},
});
});
};