目前我知道的解决方法是:
uni.request({
url: baseUrl + "register/addUser",
header: {
‘content-type‘: ‘application/json‘ //重点一application/json
},
method: "POST",
data: JSON.stringify({ //重点二JSON.stringify()
id: 123,
nikename: 456,
avatarUrl: 789
}),
success: function(res) {
console.log(res.data)
},
fail: function(err) {
console.log(err.errMsg);
}
});