export function request(url, data = {}, method = 'GET') {//请求地址,传递的参数,请求方式
return new Promise((resolve, reject) => {
wx.request({
url,
data,
method,
header: {
'X-Litemall-Token': wx.getStorageSync('token')
},
success: res => {
if (res.data.errmsg == '成功') {
resolve(res);
}
},
fail: err => {
reject('请求出现错误' + err)
}
})
})
}