|
|
@@ -12,17 +12,10 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
app.factory('httpInterceptor', ['$window', '$q', function ($window, $q) {
|
|
|
var httpInterceptor = {
|
|
|
'responseError': function (response) {
|
|
|
- var authorized = false;
|
|
|
- var headers = response.headers();
|
|
|
- angular.forEach(headers, function(header) {
|
|
|
- if (header.authorized == 'OK') {
|
|
|
- authorized = true;
|
|
|
- }
|
|
|
- })
|
|
|
- if (response.status == 401 && !authorized) {// UNAUTHORIZED
|
|
|
+ if (response.status == 401) {// UNAUTHORIZED
|
|
|
// window.location.href = response.data.loginUrl || 'index';
|
|
|
- // window.location.href = window.location.origin + window.location.pathname + '/login';
|
|
|
- window.location.reload();
|
|
|
+ window.location.href = window.location.origin + window.location.pathname + '/login';
|
|
|
+ // window.location.reload();
|
|
|
return $q.reject(response);
|
|
|
}
|
|
|
return $q.reject(response);
|