我厂的样子改变:
'use strict';
angular.module('myApp')
.factory('httpInterceptor',['$q','$location', '$rootScope', function($q, $location, $rootScope){
return {
response: function(response) {
if(response.success === false) {
console.log("Redirecting");
$location.path('/login');
return $q.reject(response);
}
return response || $q.when(response);
}
}
}]);
它吐出来的日志,但不改变路径。我能做些什么来做到这一点?
相关问题:http://stackoverflow.com/questions/25579938/location-path-not-working-from-http-interceptor/ – Sirozha