I mainly want to store the returned information in data when post returns, and find that it is not possible for setData to be written in wx.request. Finally, I can only use wx.setStorageSync storage. I just contacted Mini Program and soon wanted to ask the boss if there is any other way to save the return value.
var that=this;
Page({
data: {
mediaurl:"1"
},
onLaunch: function() {
var that = this;
wx.request({
url: "http://www.test.php/login",
data: {
UserCode: "wechart",
},
method: "post",
success: function (res) {
that.setData({
mediaurl: ""
})
}
})
}
})