Update: build && server frontend
This commit is contained in:
parent
38098497a5
commit
db79c561c7
90 changed files with 6 additions and 6 deletions
|
|
@ -1,42 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ProfilService
|
||||
{
|
||||
|
||||
constructor()
|
||||
{
|
||||
if(localStorage.getItem('id') === null) this.setId(-1);
|
||||
if(localStorage.getItem('isAdmin') === null) this.setIsAdmin(false);
|
||||
}
|
||||
|
||||
getId(): number
|
||||
{
|
||||
let idString = localStorage.getItem('id');
|
||||
if(idString === null) return -1;
|
||||
else return parseInt(idString);
|
||||
}
|
||||
|
||||
setId(id: number): void
|
||||
{
|
||||
localStorage.setItem('id', id.toString());
|
||||
}
|
||||
|
||||
isAdmin(): boolean
|
||||
{
|
||||
let isAdminString = localStorage.getItem('isAdmin');
|
||||
if(isAdminString === "T") return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
setIsAdmin(isAdmin: boolean): void
|
||||
{
|
||||
let isAdminString = "" ;
|
||||
if(isAdmin) isAdminString = "T";
|
||||
else isAdminString = "F";
|
||||
localStorage.setItem('isAdmin', isAdminString);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue