求问代码中的 result.returnvalue是干啥,这是别人做的一个登陆的代码,求分析下,谢谢
mui.ajax('127.0.0.1/pr1', {
data: {
'username': username,
'password': password
},
crossDomain: true,
headers: {
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8'
},
type: 'post', //HTTP请求类型
timeout: 10000, //超时时间设置为10秒;
success: function(data) {
var result = JSON.parse(data);
if(result.returnvalue == '1') {
console.log(JSON.stringify(result));
UserData.SetUserData(data,function(){
LoginController.GotoIndex();
PermissionsData.GetPermissions();
});
}else{
mui.toast(JSON.stringify(result.message),{ duration:'long', type:'div' });
}
},
error: function(xhr, type, errorThrown) {
mui.alert("请求错误。" + errorThrown + "状态:" + type);
}
});
9***@qq.com (作者)
嗯,找到了,是返回值json中的一个key,谢谢
2018-09-13 17:19