app.globalData.Authorization is the global variable that saves token
http({ url, data, method }) {
return new Promise((resolve, reject) => {
const app = getApp();
wx.request({
url: url,
data: data,
method,
header: {"token": app.globalData.Authorization },
success(res) {
res.statusCode === 200 ? resolve(res.data) : reject(res.data);
//
},
fail(res) {
reject(res)
}
})
})
}
}