app.js
postData: function (url, data) {
var that = this;
return new Promise(function (resolve, reject) {
wx.request({
url: that.globalData.baseURL + url,
data: data,
method: "GET",
header: {
"Content-Type": "application/json;charset=UTF-8",
"token": that.globalData.token
},
success: function (res) {
resolve(res.data);
},
fail: function (res) {
reject(res);
},
})
});
},