connexion avec le back

This commit is contained in:
MiharyR 2022-01-14 20:15:50 +01:00
parent 91e4bba793
commit 4620f0dff9
16 changed files with 178 additions and 110 deletions

View file

@ -8,8 +8,8 @@ export class ProfilService
constructor()
{
this.setId(-1);
this.setIsAdmin(false);
if(localStorage.getItem('id') === null) this.setId(-1);
if(localStorage.getItem('isAdmin') === null) this.setIsAdmin(false);
}
getId(): number
@ -24,7 +24,7 @@ export class ProfilService
localStorage.setItem('id', id.toString());
}
getIsAdmin(): boolean
isAdmin(): boolean
{
let isAdminString = localStorage.getItem('isAdmin');
if(isAdminString === "T") return true;