设置了外部web服务器
前端页面的代码:
mui.ajax('http://127.0.0.1:80/chunyu/user.php',{
data:{
type: 'signup_auth',
phone: regInfo.phone,
password: regInfo.password
},
dataType:'text',//服务器返回json格式数据
type:'post',//HTTP请求类型
timeout:10000,//超时时间设置为10秒;
success:function(data){
console.log(data);
document.querySelector('#cityResult').innerText('成功');
},
error:function(xhr,type,errorThrown){
//异常处理;
document.querySelector('#cityResult').innerText = writeObj(xhr);
console.log(errorThrown);
console.log('ajax不成功');
}
});
报错 Connection to http://127.0.0.1:80 refused