mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
merge
This commit is contained in:
@@ -44,7 +44,7 @@ export class LoginPage implements OnInit {
|
||||
private changeProfileService: ChangeProfileService,
|
||||
public ThemeService: ThemeService,
|
||||
private storageservice: StorageService,
|
||||
public permissionService: PermissionService,
|
||||
public p: PermissionService,
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -104,11 +104,20 @@ export class LoginPage implements OnInit {
|
||||
|
||||
// login to API successfully
|
||||
if (attempt) {
|
||||
|
||||
if (attempt.UserId == SessionStore.user.UserId) {
|
||||
|
||||
await this.authService.SetSession(attempt, this.userattempt);
|
||||
await this.authService.loginChat();
|
||||
await this.authService.loginToChatWs();
|
||||
|
||||
console.log(this.p.userPermission(this.permissionList.Chat.access));
|
||||
|
||||
|
||||
if(this.p.userPermission(this.permissionList.Chat.access)){
|
||||
alert('RC IN')
|
||||
await this.authService.loginChat();
|
||||
await this.authService.loginToChatWs();
|
||||
}
|
||||
|
||||
this.getToken();
|
||||
SessionStore.setInativity(true);
|
||||
|
||||
@@ -124,8 +133,11 @@ export class LoginPage implements OnInit {
|
||||
|
||||
this.changeProfileService.run();
|
||||
|
||||
await this.authService.loginChat();
|
||||
await this.authService.loginToChatWs();
|
||||
if(this.p.userPermission(this.permissionList.Chat.access)){
|
||||
await this.authService.loginChat();
|
||||
await this.authService.loginToChatWs();
|
||||
}
|
||||
|
||||
this.getToken();
|
||||
|
||||
this.router.navigateByUrl('/pin', { replaceUrl: true });
|
||||
@@ -149,13 +161,13 @@ export class LoginPage implements OnInit {
|
||||
if(pathName) {
|
||||
this.router.navigate([pathName]);
|
||||
} else {
|
||||
if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){
|
||||
if(this.p.userPermission(this.permissionList.Agenda.access) || this.p.userPermission(this.permissionList.Gabinete.access)){
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
else if(this.permissionService.userPermission(this.permissionList.Chat.access) && this.permissionService.userPermission(this.permissionList.Actions.access)){
|
||||
else if(this.p.userPermission(this.permissionList.Chat.access) && this.p.userPermission(this.permissionList.Actions.access)){
|
||||
this.router.navigate(['/home/chat']);
|
||||
}
|
||||
else if(this.permissionService.userPermission(this.permissionList.Actions.access)){
|
||||
else if(this.p.userPermission(this.permissionList.Actions.access)){
|
||||
this.router.navigate(['/home/publications']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user