小程序封装请求
export
const request = params => {
const baseUrl =
'http://api.adfadsfasfasfasdfasdf'
return
new
Promise((resolve, reject) => {
wx.request({
...params,
url: baseUrl + params.url,
success: result => {
resolve(result.data.message)
},
fail: err => {
reject(err)
}
})
})
}