feat(users): set user status to idle when long time not login

This commit is contained in:
OldHawk
2017-12-03 16:50:22 +08:00
parent ced86df811
commit 11f5f2bfec
7 changed files with 67 additions and 6 deletions

View File

@@ -119,7 +119,12 @@
vm.authentication.user = response;
$rootScope.$broadcast('auth-user-changed');
$rootScope.$broadcast('user-invitations-changed');
NotifycationService.showNotify('info', null, 'Welcome ' + response.displayName);
if (vm.authentication.user.status === 'normal') {
NotifycationService.showNotify('info', null, $translate.instant('SIGN.SIGNIN_WELCOME_NORMAL', {name: response.displayName}));
}
if (vm.authentication.user.status === 'idle') {
NotifycationService.showNotify('error', null, $translate.instant('SIGN.SIGNIN_WELCOME_IDLE', {name: response.displayName}));
}
// And redirect to the previous or home page
$state.go($state.previous.state.name || 'home', $state.previous.params);
}