uni.request({
url: this.websiteUrl+'/user/login',
data: {
userLoginName:_this.phoneData,
password:_this.passData,
},
method:'POST',
header: {
// 'custom-header': 'hello' //自定义请求头信息
},
success: (res) => {
console.log(res);
_this.isRotate=false;
if(res.status!=200){
uni.showToast({
icon: 'none',
position: 'bottom',
title: res.data.message
});
return;
}
let data = res.data.data;
if(data.portStatus=="loginSuccess"){
uni.setStorageSync('token', data.token);
uni.navigateTo({
url: 'filmList',
animationType: 'pop-in',
animationDuration: 200
});
}
else{
uni.showToast({
icon: 'none',
position: 'bottom',
title: data.errorMsg
});
}
},
fail:(res)=>{
_this.isRotate=false;
uni.showToast({
icon: 'none',
position: 'bottom',
title: '网络错误'
});
}
});