wx.request({
url: '',//请求的接口
data: {},//请求的参数,如name和id
header: {'content-type':'application/json'},//请求头设置,根据需要自己设置
method: 'GET',//请求方式
dataType: 'json',
responseType: 'text',
success: (result)=>{},//成功的回调
fail: ()=>{},//失败的回调
complete: ()=>{}//请求后的执行的函数
});
最后修改:2022 年 11 月 03 日
如果觉得我的文章对你有用,请随意赞赏