封装小程序的请求
对小程序官方的wx.request进行再次封装
最近在学习小程序的时候,学习到了对于官方的请求方法的再次封装
话不多说上代码
let times = 0
export const myRequest = (params) =>{
times++
wx.showLoading({
title: '加载中',
mask: true,
})
return new Promise((resolve,reject)=>{
wx.request({
.
原创
2020-06-19 23:07:54 ·
160 阅读 ·
0 评论