微信小程序开发(请求后台数据,封装request函数)
今天想记录一下怎么向后台请求数据,将函数进行封装,实现复用~
官方的请求方法:
https://developers.weixin.qq.com/miniprogram/dev/api/network/request/wx.request.html
这是封装好的函数:
公共函数
async function request(url, {
method = 'GET',
data
} = {}) {
wx.show.
原创
2020-07-15 11:33:01 ·
1348 阅读 ·
0 评论