export default function(options) {
return new Promise((resolve, reject) => {
wx.request({
url: options.url,
method: options.method || 'get',
data: options.data || {},
success: resolve,
fail: reject
})
})
}
小程序使用promise封装一个网络请求
猜你喜欢
转载自blog.csdn.net/qq_44162474/article/details/104740255
今日推荐
周排行