我有一个应用程序,可以搜索患者并找到重定向到处方页面的应用程序。如果没有找到任何内容,应用程序就可以了,并返回一条未找到的消息,但是当我们找到病人时,它会重定向到登录页面而不是处方页面。
这是功能代码
$http({
method: 'POST',
url: 'http://104.155.102.226:8033/patientsearch/',
data: {
'national_id': $scope.national_id,
'insurance_company':$scope.insurance_company,
'member_number': $scope.member_number,
'dob':$scope.dob,
'phone': $scope.phone_number
},
headers: {
'accept':'application/json',
'Content-Type':'application/json'
}
}).success(function(data){
if(Object.keys(data).length == 0){
$scope.message = "No Patient with those credentials found in our databases";
} else {
$timeout(function(){
sessionStorage.setItem('memberData', JSON.stringify(data));
$location.path('/doctors/prescribe');
},1);
// sessionStorage.setItem('memberData', JSON.stringify(data));
// $location.path('/doctors/prescribe');
}
//console.log(memberData);
}).error(function(error){
console.log(error)
});
答案 0 :(得分:0)
问题是没有为' / doctors / prescribe'
设置网址