传递格式:
wx.request({
url:'后台接收参数的文件路径',
method:'传递方式,是GET还是POST',
data{
//参数设置
},
header{
'Content-Type': 'application/json' //GET方式
},
header: {
"Content-Type": "application/x-www-form-urlencoded" //POST方式
},
success:function(res){//请求成功之后要做什么
console('请求成功')
},
fail:function(err){//请求失败之后要做什么
console('请求失败')
}
})