一些请求下面是我拦截它处理全局错误。但我想绕过一些http请求。有什么建议么 ?AngularJs:排除从拦截
var interceptor = ['$rootScope', '$q',function (scope, $q) {
function success(response) {
return response;
}
function error(response) {
var status = response.status;
if (status == 401) {
window.location = "./index.html#/404";
return;
}
if (status == 0) {
window.location = "./index.html#/nointernet";
}
return $q.reject(response);
}
return function (promise) {
return promise.then(success, error);
}
}];
$httpProvider.responseInterceptors.push(interceptor);
应该有接受的答案 –
但没有肯定,要求增加“自定义”属性配置对象仍然是可用的响应,是什么吗? – cipak