如图前面章节跟着老师一步一步弄都没出现问题,在编写regist.js回调函数 var serverUrl = app.serverUrl;
wx.request({
url: serverUrl + ‘/regist’,
method:“POST”,
data:{
username: username,
password: password
},
header:{
‘content-type’:‘application/json’//默认值
},
success:function(res){
console.log(res.data);
}
})
后进行测试提示找不到这个链接。。。
但我换成serverUrl:"http://localhost:8081"是可以出现和老师一样的效果的