我的第一张图片是我的网络 - >头
我的第二张图片是我的控制台
情况是尝试使用大约15-20次的错误凭据登录
我想要实现的是能够在我的客户端确定哪个是AngularJS,如果我的响应状态为429 ..我做了一个:
console.log(response)
在第二张图片上,但我无法在我的客户端确定是否收到了429状态请求
function(response){
var res_data = (response.data && response.data.data) ? response.data.data : null;
var res_status = response.status;
FlashService.Error(response[keys.issue_fields], true);
console.log(response);
console.log("----");
if (res_status == 513 && res_data && res_data[keys.issue_fields][0] == keys.email) {
vm.error = "Your email is not recognized. Please try again.";
} else if (res_status == 513 && res_data && res_data[keys.issue_fields][0] == keys.password){
vm.error = "Your email and password combination was incorrect. Please try again.";
} else if (res_status == 513 && res_data && res_data[keys.issue_fields][0] == keys.suspension){
vm.error = "Your account is inactive.";
}else if (res_status == -1) {
vm.error = "Error connecting to server.";
}else if(res_status == 429){
vm.error = "You have attempted a numerous login failed attempt.. Please try again later.";
}else {
vm.error = "Your email and password combination was incorrect. Please try again.";
}
vm.dataLoading = false;
}
PS
代码应该可以正常工作,只是我无法获得响应代码