在应用程序配置块中:
var interceptor = ['$rootScope', '$q', "base64", function(scope, $q, base64) { function success(response) { return response; } function error(response) { var status = response.status; if (status == 401) { //AuthFactory.clearUser(); window.location = "/account/login?redirectUrl=" + base64.enpre(document.URL); return; } // otherwise return $q.reject(response); } return function(promise) { return promise.then(success, error); }}];


