connexion avec le back (non testé)
This commit is contained in:
parent
22f6d316b4
commit
6b9a6d7c73
14 changed files with 215 additions and 130 deletions
|
|
@ -43,16 +43,16 @@ export class PageLoginComponent
|
|||
// Callback de "onSeConnecter"
|
||||
onSeConnecterCallback(retour: any): void
|
||||
{
|
||||
console.log(retour);
|
||||
if(retour.status !== "success")
|
||||
{
|
||||
console.log(retour);
|
||||
this.errorMessage = retour.message;
|
||||
this.hasError = true;
|
||||
}
|
||||
else {
|
||||
this.profilService.setId(retour.data.id);
|
||||
this.profilService.setIsAdmin(retour.data.is_admin)
|
||||
if(!retour.data.is_admin) this.router.navigateByUrl('admin/userList');
|
||||
if(retour.data.is_admin) this.router.navigateByUrl('admin/userList');
|
||||
else this.router.navigateByUrl('user/userList');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue