mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Redirect to home with error message when status is 401
This commit is contained in:
parent
2a054d4b55
commit
5c9242c3ed
2 changed files with 21 additions and 1 deletions
|
|
@ -14,7 +14,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('zeppelinWebApp').controller('ConfigurationCtrl', function($scope, $route, $routeParams, $location,
|
||||
$rootScope, $http, baseUrlSrv) {
|
||||
$rootScope, $http, baseUrlSrv, ngToast) {
|
||||
$scope.configrations = [];
|
||||
$scope._ = _;
|
||||
|
||||
|
|
@ -24,6 +24,16 @@ angular.module('zeppelinWebApp').controller('ConfigurationCtrl', function($scope
|
|||
$scope.configurations = data.body;
|
||||
}).
|
||||
error(function(data, status, headers, config) {
|
||||
if (status === 401) {
|
||||
ngToast.danger({
|
||||
content: 'You don\'t have permission on this page',
|
||||
verticalPosition: 'bottom',
|
||||
timeout: '3000'
|
||||
});
|
||||
setTimeout(function() {
|
||||
window.location.replace('/');
|
||||
}, 3000);
|
||||
}
|
||||
console.log('Error %o %o', status, data.message);
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -27,6 +27,16 @@ angular.module('zeppelinWebApp').controller('InterpreterCtrl',
|
|||
$http.get(baseUrlSrv.getRestApiBase() + '/interpreter/setting').success(function(data, status, headers, config) {
|
||||
$scope.interpreterSettings = data.body;
|
||||
}).error(function(data, status, headers, config) {
|
||||
if (status === 401) {
|
||||
ngToast.danger({
|
||||
content: 'You don\'t have permission on this page',
|
||||
verticalPosition: 'bottom',
|
||||
timeout: '3000'
|
||||
});
|
||||
setTimeout(function() {
|
||||
window.location.replace('/');
|
||||
}, 3000);
|
||||
}
|
||||
console.log('Error %o %o', status, data.message);
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue