网络请求报401错误
wx.request({
url: ‘http://xxx.xx.xx.xx:xxxx/hzzcteam/do/app/uiaction?mobileapp=true’,
data:data1,
header: {
‘Set-Cookie’: sessions,
‘Content-Type’: ‘application/json’,
},
method: ‘POST’,
success:function(res){
console.log(JSON.stringify(res));
if (res.statusCode === 200){
callback(true);
}else{
}
},
fail:function(err){
}
})
小程序往服务器发请求 报 POST http://xxx.xx.xx.xx:xxxx/hzzcteam/do/app/uiaction?mobileapp=true 401 (Unauthorized)这么个错,谁知道是什么原因导致的?