Angularjs 如何在我的angular应用程序中阻止页面重定向到signin
我正在尝试处理重置密码控制器中的状态代码401,但它会自动重定向到interceptor中定义的登录页面。这是我这两部分的代码Angularjs 如何在我的angular应用程序中阻止页面重定向到signin,angularjs,Angularjs,我正在尝试处理重置密码控制器中的状态代码401,但它会自动重定向到interceptor中定义的登录页面。这是我这两部分的代码 else if(error.status === 401){ // console.log("1111") // $location.path("/activate/:activationCode"); // console.log($location.path()) //if($location.path=="/signin") $tra
else if(error.status === 401){
// console.log("1111")
// $location.path("/activate/:activationCode");
// console.log($location.path())
//if($location.path=="/signin")
$translate('UNAUTHORIZED_ACT').then(function(translation){
self.alert ={
type: 'danger',
msg: translation
}; setAlert(self.alert);
$location.path("/activate/:activationCode");
})
console.log($location.path())
// if($location.path=="/signin")
{
$location.path("resetPassword/:resetToken");
console.log("resetpswdcase")
$translate('PSWD_RESET_TOKEN_MISSING').then(function(translation){
self.alert ={
type: 'danger',
msg: translation
}; setAlert(self.alert);
})
}
}
if (response.status === 401 || response.status === 403) {
if($rootScope.isAuthenticated){
$translate('UNAUTHORIZED').then(function(translation){
Logger.logUnauthorizedRouteError();
})
} else {
$location.path('/signin');
}
}
那么,无论是否接触拦截器,如何在控制器中阻止页面重定向