微信小程序的数据交互

wex.result:
官方文档:https://developers.weixin.qq.com/miniprogram/dev/api/network/request/wx.request.html
思维是前后端分离,后端发布一个URL地址,前端调用。在微信小程序中,是通过wx.request( )发起请求。
wx.request({
url: ‘https://wxdemo.com/login’,
data: {
username: ‘’ ,
password: ‘’
},
header: {
‘content-type’: ‘application/json’ // 默认值
},
success: function(res) {
console.log(res.data)
}
})
wx.result()方法传递了一些参数,这些参数起到了不同作用!在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_43218075/article/details/82955962