Merge branch 'dev' into paul
This commit is contained in:
commit
edcd583de8
@ -9,15 +9,28 @@
|
|||||||
'is-invalid': signupForm.controls['nomFc'].touched && !signupForm.controls['nomFc'].valid}">
|
'is-invalid': signupForm.controls['nomFc'].touched && !signupForm.controls['nomFc'].valid}">
|
||||||
<label for="floatingInputNom">Nom **</label>
|
<label for="floatingInputNom">Nom **</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div class="form-floating">
|
<!-- <div class="form-floating">
|
||||||
<select type="number" class="form-control" id="floatingInputCategories" placeholder="" name="categories"
|
<select type="number" class="form-control" id="floatingInputCategories" placeholder="" name="categories"
|
||||||
formControlName="typerestausFc">
|
formControlName="typerestausFc">
|
||||||
<option value=null></option>
|
<option value=null></option>
|
||||||
<option *ngFor="let category of listCategories" value={{category.id}}>{{category.libelle}}</option>
|
<option *ngFor="let category of listCategories" value={{category.id}}>{{category.libelle}}</option>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<label for="floatingInputlastName">Categorie</label>
|
<label for="floatingInputlastName">Categorie</label>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
<ul>
|
||||||
|
<div class="form-floating">
|
||||||
|
<li *ngFor="let category of listCategories$ | async ">
|
||||||
|
<input type="checkbox" (change)="onCheckChange($event)" [value]="category.id"> {{
|
||||||
|
category.libelle }}
|
||||||
|
</li>
|
||||||
|
</div>
|
||||||
|
</ul>
|
||||||
|
<!-- <div class="form-group form-check" *ngFor="let category of listCategories$ | async">
|
||||||
|
<input type="checkbox" formControlName="typerestausFc" id="acceptTerms" class="form-check-input" />
|
||||||
|
<label for="acceptTerms" class="form-check-label">{{ category.libelle }}</label>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="text" class="form-control" id="floatingInputAdresse" placeholder="" name="adresse"
|
<input type="text" class="form-control" id="floatingInputAdresse" placeholder="" name="adresse"
|
||||||
formControlName="adresseFc"
|
formControlName="adresseFc"
|
||||||
|
@ -16,18 +16,15 @@ export class AddRestauComponent implements OnInit {
|
|||||||
|
|
||||||
public signupForm: FormGroup;
|
public signupForm: FormGroup;
|
||||||
public errorMessage?: string;
|
public errorMessage?: string;
|
||||||
public listCategories : any[];
|
public listCategories$: Observable<any[]>;
|
||||||
public expanded = false;
|
public expanded = false;
|
||||||
|
|
||||||
constructor(private router: Router, private apiBackService: ApiBackService) {
|
constructor(private router: Router, private apiBackService: ApiBackService) {
|
||||||
this.signupForm = new FormGroup({});
|
this.signupForm = new FormGroup({});
|
||||||
this.listCategories = [];
|
this.listCategories$ = this.getCategories();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
|
||||||
this.getCategories();
|
|
||||||
|
|
||||||
this.signupForm = new FormGroup({
|
this.signupForm = new FormGroup({
|
||||||
nomFc: new FormControl('', [Validators.required]),
|
nomFc: new FormControl('', [Validators.required]),
|
||||||
prixFc: new FormControl(''),
|
prixFc: new FormControl(''),
|
||||||
@ -39,17 +36,12 @@ export class AddRestauComponent implements OnInit {
|
|||||||
surPlaceFc: new FormControl(''),
|
surPlaceFc: new FormControl(''),
|
||||||
aEmporterFc: new FormControl(''),
|
aEmporterFc: new FormControl(''),
|
||||||
accesPMRFc: new FormControl(''),
|
accesPMRFc: new FormControl(''),
|
||||||
// typerestausFc : new FormControl('')
|
typerestausFc: new FormArray([])
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public getCategories() : void{
|
public getCategories(): Observable<any[]> {
|
||||||
this.apiBackService.getCategories().subscribe((listCategories: any[]) => {
|
return this.apiBackService.getCategories();
|
||||||
// console.log(listCategories);
|
|
||||||
|
|
||||||
this.listCategories = listCategories;
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,7 +58,10 @@ export class AddRestauComponent implements OnInit {
|
|||||||
const surPlaceFc = this.signupForm.value['surPlaceFc'];
|
const surPlaceFc = this.signupForm.value['surPlaceFc'];
|
||||||
const aEmporterFc = this.signupForm.value['aEmporterFc'];
|
const aEmporterFc = this.signupForm.value['aEmporterFc'];
|
||||||
const accesPMRFc = this.signupForm.value['accesPMRFc'];
|
const accesPMRFc = this.signupForm.value['accesPMRFc'];
|
||||||
// const typerestausFc = this.signupForm.value['typerestausFc'];
|
const typerestausFc = this.signupForm.value['typerestausFc'];
|
||||||
|
|
||||||
|
console.log(typerestausFc);
|
||||||
|
|
||||||
|
|
||||||
const restaurant: Restaurant = {
|
const restaurant: Restaurant = {
|
||||||
latitude: latitudeFc,
|
latitude: latitudeFc,
|
||||||
@ -79,7 +74,7 @@ export class AddRestauComponent implements OnInit {
|
|||||||
surPlace: surPlaceFc,
|
surPlace: surPlaceFc,
|
||||||
aEmporter: aEmporterFc,
|
aEmporter: aEmporterFc,
|
||||||
accesPMR: accesPMRFc,
|
accesPMR: accesPMRFc,
|
||||||
// typerestaus : typerestausFc
|
typerestaus: typerestausFc
|
||||||
}
|
}
|
||||||
|
|
||||||
if (restaurant.latitude !== '' &&
|
if (restaurant.latitude !== '' &&
|
||||||
@ -88,7 +83,6 @@ export class AddRestauComponent implements OnInit {
|
|||||||
restaurant.adresse !== '') {
|
restaurant.adresse !== '') {
|
||||||
this.apiBackService.addRestaurant(restaurant).subscribe(
|
this.apiBackService.addRestaurant(restaurant).subscribe(
|
||||||
resp =>
|
resp =>
|
||||||
|
|
||||||
this.router.navigate(['restaurants'])
|
this.router.navigate(['restaurants'])
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@ -98,5 +92,29 @@ export class AddRestauComponent implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onCheckChange(event : any) {
|
||||||
|
const formArray: FormArray = this.signupForm.get('typerestausFc') as FormArray;
|
||||||
|
console.log(FormArray);
|
||||||
|
|
||||||
|
if (event.target.checked) {
|
||||||
|
|
||||||
|
formArray.push(new FormControl({id : event.target.value}));
|
||||||
|
|
||||||
|
}else {
|
||||||
|
let i: number = 0;
|
||||||
|
|
||||||
|
formArray.controls.forEach((ctrl) => {
|
||||||
|
|
||||||
|
if (ctrl.value['id'] == event.target.value) {
|
||||||
|
formArray.removeAt(i);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
i++;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
{{restau.nom}}
|
{{restau.nom}}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
<button class="btn btn-warn" type="button" (click)="modifRestau(restau.id)"><i class="bi bi-gear"></i></button>
|
||||||
<button class="btn btn-danger" type="button" (click)="deleteRestau(restau.id)"><i class="bi bi-trash"></i></button>
|
<button class="btn btn-danger" type="button" (click)="deleteRestau(restau.id)"><i class="bi bi-trash"></i></button>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||||
import { Restaurant } from 'src/app/pages/models/restaurant';
|
import { Restaurant } from 'src/app/pages/models/restaurant';
|
||||||
import { ApiBackService } from 'src/app/services/api-back.service';
|
import { ApiBackService } from 'src/app/services/api-back.service';
|
||||||
|
|
||||||
@ -10,14 +10,13 @@ import { ApiBackService } from 'src/app/services/api-back.service';
|
|||||||
export class UpdateDelRestauComponent implements OnInit {
|
export class UpdateDelRestauComponent implements OnInit {
|
||||||
|
|
||||||
restauList : Restaurant[];
|
restauList : Restaurant[];
|
||||||
|
@Output() idRestauAModif = new EventEmitter<number>();
|
||||||
|
|
||||||
constructor(private apiBackService : ApiBackService) {
|
constructor(private apiBackService : ApiBackService) {
|
||||||
this.restauList = [];
|
this.restauList = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
saveRestauList(event : any){
|
saveRestauList(event : any){
|
||||||
@ -28,11 +27,12 @@ export class UpdateDelRestauComponent implements OnInit {
|
|||||||
deleteRestau(idRestau : number | undefined){
|
deleteRestau(idRestau : number | undefined){
|
||||||
this.apiBackService.deleteRestau(idRestau).subscribe(
|
this.apiBackService.deleteRestau(idRestau).subscribe(
|
||||||
resp =>{
|
resp =>{
|
||||||
|
|
||||||
|
|
||||||
this.restauList = this.restauList.filter(restaus => restaus.id != idRestau)
|
this.restauList = this.restauList.filter(restaus => restaus.id != idRestau)
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
modifRestau(idRestau : number | undefined){
|
||||||
|
this.idRestauAModif.emit(idRestau);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -7,16 +7,20 @@ import { RestoPageComponent } from './pages/resto-page/resto-page.component';
|
|||||||
import { PageNotFoundComponent } from './pages/page-not-found/page-not-found.component';
|
import { PageNotFoundComponent } from './pages/page-not-found/page-not-found.component';
|
||||||
import { FiltersPageComponent } from './pages/filters-page/filters-page.component';
|
import { FiltersPageComponent } from './pages/filters-page/filters-page.component';
|
||||||
import { SigninComponent } from './pages/signin/signin.component';
|
import { SigninComponent } from './pages/signin/signin.component';
|
||||||
|
import { SignupComponent } from './pages/signup/signup.component';
|
||||||
import { AdminPageComponent } from './pages/admin-page/admin-page.component';
|
import { AdminPageComponent } from './pages/admin-page/admin-page.component';
|
||||||
import { AuthGuard } from './services/auth.guard';
|
import { AuthGuard } from './services/auth.guard';
|
||||||
|
import { PageAccountComponent } from './pages/page-account/page-account.component';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{ path: '', redirectTo: 'signin', pathMatch: 'full' },
|
{ path: '', redirectTo: 'home', pathMatch: 'full' },
|
||||||
{path: 'signin', component: SigninComponent},
|
{path: 'signin', component: SigninComponent},
|
||||||
|
{path: 'signup', component: SignupComponent},
|
||||||
{ path: 'home', component: HomePageComponent },
|
{ path: 'home', component: HomePageComponent },
|
||||||
{ path: 'categories', component: ListCategoriesComponent },
|
{ path: 'categories', component: ListCategoriesComponent },
|
||||||
{ path: 'favoris', component: FavorisUserComponent },
|
{ path: 'favoris', component: FavorisUserComponent },
|
||||||
{ path: 'filtres', component: FiltersPageComponent },
|
{ path: 'filtres', component: FiltersPageComponent },
|
||||||
|
{ path: 'profil', component: PageAccountComponent },
|
||||||
{ path: 'Deconnexion', redirectTo: 'home'},
|
{ path: 'Deconnexion', redirectTo: 'home'},
|
||||||
{path: 'restaurants', canActivate: [AuthGuard], component: RestoPageComponent},
|
{path: 'restaurants', canActivate: [AuthGuard], component: RestoPageComponent},
|
||||||
{path: 'page-not-found',component: PageNotFoundComponent},
|
{path: 'page-not-found',component: PageNotFoundComponent},
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
<app-header-logo *ngIf="router.url != '/signin'"></app-header-logo>
|
<app-header-logo *ngIf="router.url != '/signin'"></app-header-logo>
|
||||||
<app-nav-bar *ngIf="router.url != '/signin'"></app-nav-bar>
|
<app-nav-bar *ngIf="router.url != '/signin'"></app-nav-bar>
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
<!-- <app-footer *ngIf="router.url != '/signin'"></app-footer> -->
|
<app-footer *ngIf="router.url != '/signin'"></app-footer>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { NavigationEnd, Router } from '@angular/router';
|
import { NavigationEnd, Router } from '@angular/router';
|
||||||
import { ApiBackService } from './services/api-back.service';
|
import { ApiBackService } from './services/api-back.service';
|
||||||
|
import { AuthGuard } from './services/auth.guard';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
@ -11,7 +12,7 @@ export class AppComponent {
|
|||||||
title = 'simpleat';
|
title = 'simpleat';
|
||||||
dontShow: boolean = false;
|
dontShow: boolean = false;
|
||||||
|
|
||||||
constructor(public router:Router, private apiBackService : ApiBackService){
|
constructor(public router:Router, private apiBackService : ApiBackService, private authgard : AuthGuard){
|
||||||
this.router.events.subscribe(e=>{
|
this.router.events.subscribe(e=>{
|
||||||
//console.log(e);
|
//console.log(e);
|
||||||
if(e instanceof NavigationEnd){
|
if(e instanceof NavigationEnd){
|
||||||
@ -27,5 +28,6 @@ export class AppComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {}
|
ngOnInit(): void {}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@ import { UpdateDelRestauComponent } from './admin-component/update-del-restau/up
|
|||||||
import { HeaderLogoComponent } from './header/components/header-logo/header-logo.component';
|
import { HeaderLogoComponent } from './header/components/header-logo/header-logo.component';
|
||||||
import { AuthInterceptor } from './services/auth.interceptor';
|
import { AuthInterceptor } from './services/auth.interceptor';
|
||||||
import { FavorisUserComponent } from './pages/favoris-user/favoris-user.component';
|
import { FavorisUserComponent } from './pages/favoris-user/favoris-user.component';
|
||||||
|
import { SignupComponent } from './pages/signup/signup.component';
|
||||||
|
import { PageAccountComponent } from './pages/page-account/page-account.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
@ -46,7 +48,9 @@ import { FavorisUserComponent } from './pages/favoris-user/favoris-user.componen
|
|||||||
AddRestauComponent,
|
AddRestauComponent,
|
||||||
UpdateDelRestauComponent,
|
UpdateDelRestauComponent,
|
||||||
HeaderLogoComponent,
|
HeaderLogoComponent,
|
||||||
FavorisUserComponent
|
FavorisUserComponent,
|
||||||
|
SignupComponent,
|
||||||
|
PageAccountComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
|
@ -10,12 +10,13 @@
|
|||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
<div class="collapse navbar-collapse justify-content-end" id="navbarNavAltMarkup">
|
<div class="collapse navbar-collapse justify-content-end" id="navbarNavAltMarkup">
|
||||||
<div class="navbar-nav ">
|
<div class="navbar-nav navbar-light">
|
||||||
<a routerLink="home" routerLinkActive="active-custom" class="nav-link p-4 pe-5 " style="font-size: 21px;">Accueil</a>
|
<a routerLink="home" routerLinkActive="active-custom" class="nav-link p-4 pe-5 " style="font-size: 21px;">Accueil</a>
|
||||||
<a routerLink="categories" routerLinkActive="active-custom" class="nav-link p-4 pe-5" style="font-size: 21px;">Categories</a>
|
<a routerLink="categories" routerLinkActive="active-custom" class="nav-link p-4 pe-5" style="font-size: 21px;">Categories</a>
|
||||||
<a routerLink="restaurants" routerLinkActive="active-custom" class="nav-link p-4 pe-5" style="font-size: 21px;">Restaurants</a>
|
<a routerLink="restaurants" routerLinkActive="active-custom" class="nav-link p-4 pe-5" style="font-size: 21px;">Restaurants</a>
|
||||||
<a routerLink="filtres" routerLinkActive="active-custom" class="nav-link p-4 pe-5" style="font-size: 21px;">Filtres</a>
|
<a routerLink="filtres" routerLinkActive="active-custom" class="nav-link p-4 pe-5" style="font-size: 21px;">Filtres</a>
|
||||||
<a routerLink="favoris" routerLinkActive="active-custom" class="nav-link p-4 pe-5" style="font-size: 21px;">Mes favoris</a>
|
<a routerLink="favoris" routerLinkActive="active-custom" class="nav-link p-4 pe-5" style="font-size: 21px;">Mes favoris</a>
|
||||||
|
<a routerLink="profil" routerLinkActive="active-custom" class="nav-link p-4 pe-5" style="font-size: 21px;">Mon profil</a>
|
||||||
<a routerLink="deconnexion" routerLinkActive="active-custom" (click) = "onCloseSession()" class="nav-link p-4 pe-5" style="font-size: 21px;">Deconnexion</a>
|
<a routerLink="deconnexion" routerLinkActive="active-custom" (click) = "onCloseSession()" class="nav-link p-4 pe-5" style="font-size: 21px;">Deconnexion</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -23,7 +24,6 @@
|
|||||||
<div id="image-header">
|
<div id="image-header">
|
||||||
<img src="assets/images-header/bandeau2.png" alt="fond_header">
|
<img src="assets/images-header/bandeau2.png" alt="fond_header">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,15 +9,21 @@ import { environment } from 'src/environments/environment';
|
|||||||
styleUrls: ['./nav-bar.component.scss']
|
styleUrls: ['./nav-bar.component.scss']
|
||||||
})
|
})
|
||||||
export class NavBarComponent implements OnInit {
|
export class NavBarComponent implements OnInit {
|
||||||
tokenKey = environment.tokenKey;
|
|
||||||
|
|
||||||
constructor( private tokenService : TokenService, public route: Router) { }
|
private tokenKey: string;
|
||||||
|
|
||||||
|
|
||||||
|
constructor( private tokenService : TokenService, public route: Router) {
|
||||||
|
|
||||||
|
this.tokenKey = environment.tokenKey;
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
onCloseSession() : void {
|
onCloseSession() : void {
|
||||||
this.tokenService.destroyToken();
|
|
||||||
|
this.tokenService.destroyToken(this.tokenKey);
|
||||||
this.route.navigate(['signin']);
|
this.route.navigate(['signin']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="d-flex flex-row justify-content-around"><div>
|
<div class="d-flex flex-wrap justify-content-around">
|
||||||
|
<div>
|
||||||
<app-add-restau ></app-add-restau>
|
<app-add-restau ></app-add-restau>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="search-bar">
|
<div class="search-bar">
|
||||||
<app-update-del-restau ></app-update-del-restau>
|
<app-update-del-restau ></app-update-del-restau>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<app-signup></app-signup>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
.search-bar{
|
|
||||||
width : 30%;
|
|
||||||
}
|
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<h2 class="accordion-header" id="panelsStayOpen-headingOne">
|
<h2 class="accordion-header" id="panelsStayOpen-headingOne">
|
||||||
<button class="accordion-button" type="button" data-bs-toggle="collapse"
|
<button class="btn shadow accordion-button collapsed" type="button" data-bs-toggle="collapse"
|
||||||
data-bs-target="#panelsStayOpen-collapseOne">
|
data-bs-target="#panelsStayOpen-collapseOne">
|
||||||
<p style="font-family:'Roboto';font-size: 20px;">Distance</p>
|
<p style="font-family:'Roboto';font-size: 20px;">Distance</p>
|
||||||
</button>
|
</button>
|
||||||
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<h2 class="accordion-header" id="panelsStayOpen-headingTwo">
|
<h2 class="accordion-header" id="panelsStayOpen-headingTwo">
|
||||||
<button class="accordion-button" type="button" data-bs-toggle="collapse"
|
<button class="btn shadow accordion-button collapsed" type="button" data-bs-toggle="collapse"
|
||||||
data-bs-target="#panelsStayOpen-collapseTwo">
|
data-bs-target="#panelsStayOpen-collapseTwo">
|
||||||
<p style="font-family:'Roboto'; font-size: 20px;">Prix</p>
|
<p style="font-family:'Roboto'; font-size: 20px;">Prix</p>
|
||||||
</button>
|
</button>
|
||||||
@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<h2 class="accordion-header" id="panelsStayOpen-headingThree">
|
<h2 class="accordion-header" id="panelsStayOpen-headingThree">
|
||||||
<button class="accordion-button" type="button" data-bs-toggle="collapse"
|
<button class="btn shadow accordion-button collapsed" type="button" data-bs-toggle="collapse"
|
||||||
data-bs-target="#panelsStayOpen-collapseThree">
|
data-bs-target="#panelsStayOpen-collapseThree">
|
||||||
<p style="font-family:'Roboto'; font-size: 20px;">Sur Place / A Emporter</p>
|
<p style="font-family:'Roboto'; font-size: 20px;">Sur Place / A Emporter</p>
|
||||||
</button>
|
</button>
|
||||||
@ -91,7 +91,7 @@
|
|||||||
|
|
||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<h2 class="accordion-header" id="panelsStayOpen-headingFour">
|
<h2 class="accordion-header" id="panelsStayOpen-headingFour">
|
||||||
<button class="accordion-button" type="button" data-bs-toggle="collapse"
|
<button class="btn shadow accordion-button collapsed" type="button" data-bs-toggle="collapse"
|
||||||
data-bs-target="#panelsStayOpen-collapseFour">
|
data-bs-target="#panelsStayOpen-collapseFour">
|
||||||
<p style="font-family:'Roboto'; font-size: 20px;">Accès PMR</p>
|
<p style="font-family:'Roboto'; font-size: 20px;">Accès PMR</p>
|
||||||
</button>
|
</button>
|
||||||
|
@ -8,21 +8,18 @@
|
|||||||
|
|
||||||
|
|
||||||
.titre{
|
.titre{
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
margin: 2.5em 0 0.5em 8.2em;
|
margin: 2.5em 0 0.5em 8.2em;
|
||||||
color: #CE0000;
|
color: #CE0000;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.accordion{
|
.accordion{
|
||||||
padding-top: 100px;
|
padding-top: 100px;
|
||||||
max-width: 30%;
|
max-width: 40%;
|
||||||
margin : 0 auto;
|
margin : 0 auto;
|
||||||
margin-bottom: 100px;
|
margin-bottom: 100px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.accordion-body{
|
.accordion-body{
|
||||||
@ -56,8 +53,28 @@ filter: drop-shadow(0 0 0.2rem grey);
|
|||||||
}
|
}
|
||||||
|
|
||||||
span{
|
span{
|
||||||
|
|
||||||
font-weight: 500 ;
|
font-weight: 500 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.accordion-button.collapsed {
|
||||||
|
background: #CE0000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accordion-button.collapsed::after {
|
||||||
|
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width:768px) {
|
||||||
|
|
||||||
|
span{
|
||||||
|
font-size: 2vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
p{
|
||||||
|
font-size: 2vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,5 +10,5 @@ export interface Restaurant {
|
|||||||
aEmporter?: boolean;
|
aEmporter?: boolean;
|
||||||
accesPMR?: boolean;
|
accesPMR?: boolean;
|
||||||
surPlace?: boolean;
|
surPlace?: boolean;
|
||||||
typerestaus ?: any[];
|
typerestaus ?: [{id : number}];
|
||||||
}
|
}
|
||||||
|
5
src/app/pages/models/roleList.ts
Normal file
5
src/app/pages/models/roleList.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export enum RoleList {
|
||||||
|
ROLE_ADMIN = 'ROLE_ADMIN',
|
||||||
|
ROLE_CREATOR = 'ROLE_CREATOR',
|
||||||
|
ROLE_READER = 'ROLE_READER'
|
||||||
|
}
|
@ -1,8 +1,9 @@
|
|||||||
export interface User {
|
export interface User {
|
||||||
id?:number;
|
id?:number;
|
||||||
prenom: string;
|
prenom: string;
|
||||||
lastName: string;
|
nom: string;
|
||||||
email: string;
|
email: string;
|
||||||
password?: string;
|
password?: string;
|
||||||
preference ?: object;
|
preference ?: object;
|
||||||
|
roleList ?: string[];
|
||||||
}
|
}
|
||||||
|
20
src/app/pages/page-account/page-account.component.html
Normal file
20
src/app/pages/page-account/page-account.component.html
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<div class="container mt-5">
|
||||||
|
<form class="row g-2" [formGroup]="userInfo">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<label for="inputFirstName" class="form-label">Prénom</label>
|
||||||
|
<input type="text" class="form-control" id="inputFirstName" formControlName="firstName" readonly="readonly">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<label for="inputLastName" class="form-label">Nom</label>
|
||||||
|
<input type="text" class="form-control" id="inputLastName" formControlName="lastName" readonly="readonly">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<label for="inputEmail" class="form-label">Email</label>
|
||||||
|
<input type="email" class="form-control" id="inputEmail" formControlName="email" readonly="readonly">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<label for="inputEmail" class="form-label">Role</label>
|
||||||
|
<input type="RoleList" class="form-control" id="inputRoleList" formControlName="RoleList" readonly="readonly">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
25
src/app/pages/page-account/page-account.component.spec.ts
Normal file
25
src/app/pages/page-account/page-account.component.spec.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { PageAccountComponent } from './page-account.component';
|
||||||
|
|
||||||
|
describe('PageAccountComponent', () => {
|
||||||
|
let component: PageAccountComponent;
|
||||||
|
let fixture: ComponentFixture<PageAccountComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ PageAccountComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(PageAccountComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
38
src/app/pages/page-account/page-account.component.ts
Normal file
38
src/app/pages/page-account/page-account.component.ts
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||||
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
|
import { RoleList } from '../models/roleList';
|
||||||
|
import { User } from '../models/user';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-page-account',
|
||||||
|
templateUrl: './page-account.component.html',
|
||||||
|
styleUrls: ['./page-account.component.scss']
|
||||||
|
})
|
||||||
|
export class PageAccountComponent implements OnInit {
|
||||||
|
|
||||||
|
public userInfo: FormGroup;
|
||||||
|
|
||||||
|
constructor(private fb: FormBuilder, private authService: AuthService) {
|
||||||
|
this.userInfo = this.initForm();
|
||||||
|
|
||||||
|
this.authService.getConnectedUserInfo()?.subscribe(
|
||||||
|
(user: User) => {
|
||||||
|
this.userInfo = this.initForm(user);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
}
|
||||||
|
|
||||||
|
private initForm(user?: User): FormGroup {
|
||||||
|
return this.fb.group({
|
||||||
|
firstName: [user ? user.prenom : ''],
|
||||||
|
lastName: [user ? user.nom : ''],
|
||||||
|
email: [user ? user.email : ''],
|
||||||
|
RoleList: [user ? user.roleList : '']
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,6 @@
|
|||||||
<div class="signin-form text-center">
|
<div class="signin-form text-center">
|
||||||
<main class="form-signin d-inline-flex">
|
<main class="form-signin d-inline-flex">
|
||||||
<form (ngSubmit)="onSubmit(signinForm)" #signinForm="ngForm">
|
<form (ngSubmit)="onSubmit(signinForm)" #signinForm="ngForm">
|
||||||
<h5>Merci de vous connecter</h5>
|
|
||||||
<img src="../../../assets/images-header/logo.png"><br>
|
<img src="../../../assets/images-header/logo.png"><br>
|
||||||
<br>Le bon plan pour manger<br>
|
<br>Le bon plan pour manger<br>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
|
71
src/app/pages/signup/signup.component.html
Normal file
71
src/app/pages/signup/signup.component.html
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
<div class="signup-form text-center">
|
||||||
|
<main class="form-signup">
|
||||||
|
<form (ngSubmit)="onSubmit()" [formGroup]="signupForm">
|
||||||
|
<h1>Inscription d'un membre</h1>
|
||||||
|
<div class="form-floating">
|
||||||
|
<input type="text"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingInputfirstName"
|
||||||
|
placeholder=""
|
||||||
|
name="firstName"
|
||||||
|
formControlName="firstNameFc"
|
||||||
|
[ngClass]="{'is-valid' : signupForm.controls['firstNameFc'].touched && signupForm.controls['firstNameFc'].valid,
|
||||||
|
'is-invalid': signupForm.controls['firstNameFc'].touched && !signupForm.controls['firstNameFc'].valid}">
|
||||||
|
<label for="floatingInputfirstName">Prénom</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-floating">
|
||||||
|
<input type="text"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingInputlastName"
|
||||||
|
placeholder=""
|
||||||
|
name="lastName"
|
||||||
|
formControlName="lastNameFc"
|
||||||
|
[ngClass]="{'is-valid' : signupForm.controls['lastNameFc'].touched && signupForm.controls['lastNameFc'].valid,
|
||||||
|
'is-invalid': signupForm.controls['lastNameFc'].touched && !signupForm.controls['lastNameFc'].valid}">
|
||||||
|
<label for="floatingInputlastName">Nom</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-floating">
|
||||||
|
<input type="email"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingInput"
|
||||||
|
placeholder=""
|
||||||
|
name="email"
|
||||||
|
formControlName="emailFc"
|
||||||
|
[ngClass]="{'is-valid' : signupForm.controls['emailFc'].touched && signupForm.controls['emailFc'].valid,
|
||||||
|
'is-invalid': signupForm.controls['emailFc'].touched && !signupForm.controls['emailFc'].valid}">
|
||||||
|
<label for="floatingInput">Adresse email **</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-floating">
|
||||||
|
<input type="password"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingPassword"
|
||||||
|
placeholder=""
|
||||||
|
name="password"
|
||||||
|
formControlName="passwordFc"
|
||||||
|
[ngClass]="{'is-valid' : signupForm.controls['passwordFc'].touched && signupForm.controls['passwordFc'].valid,
|
||||||
|
'is-invalid': signupForm.controls['passwordFc'].touched && !signupForm.controls['passwordFc'].valid}">
|
||||||
|
<label for="floatingPassword">Mot de passe **</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-floating">
|
||||||
|
<select class="form-select" id="roleList" formControlName="roleFc">
|
||||||
|
<option *ngFor="let c of roleList | keyvalue" value={{c.value}}>{{c.value}}</option>
|
||||||
|
</select>
|
||||||
|
<label for="roleList">Selectionner un rôle **</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="alertMessage" class="alert alert-danger">
|
||||||
|
<p class="alert-link">{{alertMessage}}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="successMessage" class="alert alert-success">
|
||||||
|
<p class="alert-link">{{successMessage}}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="w-100 btn btn-lg btn-success"
|
||||||
|
type="submit"
|
||||||
|
[disabled]="signupForm.invalid">Inscription</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</main>
|
||||||
|
</div>
|
31
src/app/pages/signup/signup.component.scss
Normal file
31
src/app/pages/signup/signup.component.scss
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
.signup-form {
|
||||||
|
height: 100vh;
|
||||||
|
padding-top: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signup {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 330px;
|
||||||
|
padding: 15px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signup .checkbox {
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signup .form-floating:focus-within {
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signup input[type="email"] {
|
||||||
|
margin-bottom: -1px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signup input[type="password"] {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
}
|
25
src/app/pages/signup/signup.component.spec.ts
Normal file
25
src/app/pages/signup/signup.component.spec.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { SignupComponent } from './signup.component';
|
||||||
|
|
||||||
|
describe('SignupComponent', () => {
|
||||||
|
let component: SignupComponent;
|
||||||
|
let fixture: ComponentFixture<SignupComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ SignupComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(SignupComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
69
src/app/pages/signup/signup.component.ts
Normal file
69
src/app/pages/signup/signup.component.ts
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
|
import { RoleList } from '../models/roleList';
|
||||||
|
import { User } from '../models/user';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-signup',
|
||||||
|
templateUrl: './signup.component.html',
|
||||||
|
styleUrls: ['./signup.component.scss']
|
||||||
|
})
|
||||||
|
export class SignupComponent implements OnInit {
|
||||||
|
public signupForm: FormGroup;
|
||||||
|
public roleList: typeof RoleList;
|
||||||
|
public alertMessage?: string;
|
||||||
|
public successMessage?: string;
|
||||||
|
|
||||||
|
|
||||||
|
constructor(private authService: AuthService, private router: Router) {
|
||||||
|
this.signupForm = new FormGroup({});
|
||||||
|
this.roleList = RoleList;
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
// FormGroupe => Group de champs de saisie (notre objet)
|
||||||
|
// FormControl => Les champs de saisie (nos propriétés)
|
||||||
|
this.signupForm = new FormGroup({
|
||||||
|
firstNameFc : new FormControl(''),
|
||||||
|
lastNameFc : new FormControl(''),
|
||||||
|
emailFc : new FormControl('', [Validators.email, Validators.required, Validators.pattern(/^([\w\.\-_]+)?\w+@[\w-_]+(\.\w+){1,}/igm)]), // chercher une meilleure regex
|
||||||
|
passwordFc : new FormControl('', [Validators.minLength(8), Validators.required]),
|
||||||
|
roleFc : new FormControl('')
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log(this.roleList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public onSubmit(): void {
|
||||||
|
|
||||||
|
if(confirm("Êtes-vous sur d'ajouter ce membre ?")){
|
||||||
|
|
||||||
|
const firstNameValue = this.signupForm.value['firstNameFc'];
|
||||||
|
const lastNameValue = this.signupForm.value['lastNameFc'];
|
||||||
|
const emailValue = this.signupForm.value['emailFc'];
|
||||||
|
const passwordValue = this.signupForm.value['passwordFc'];
|
||||||
|
const roleValue = this.signupForm.value['roleFc'];
|
||||||
|
|
||||||
|
const user: User = {
|
||||||
|
prenom: firstNameValue,
|
||||||
|
nom: lastNameValue,
|
||||||
|
email: emailValue,
|
||||||
|
password: passwordValue,
|
||||||
|
roleList : [roleValue]
|
||||||
|
}
|
||||||
|
|
||||||
|
if(user.email !== '' && user.password !== '') {
|
||||||
|
this.authService.signup(user).subscribe(
|
||||||
|
resp => {
|
||||||
|
this.successMessage = "Membre ajouté !";
|
||||||
|
}
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
this.alertMessage = "Erreur d'ajout !";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -31,7 +31,7 @@ export class AuthGuard implements CanActivate {
|
|||||||
const dateExp = new Date(decodedToken.exp * 1000);
|
const dateExp = new Date(decodedToken.exp * 1000);
|
||||||
if(new Date() >= dateExp) {
|
if(new Date() >= dateExp) {
|
||||||
// le token a expiré, je n'autorise pas l'accès
|
// le token a expiré, je n'autorise pas l'accès
|
||||||
this.tokenService.destroyToken();
|
this.tokenService.destroyToken(this.tokenKey);
|
||||||
this.router.navigate(['signin']);
|
this.router.navigate(['signin']);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,9 @@ import { Injectable } from '@angular/core';
|
|||||||
import { map, Observable } from 'rxjs';
|
import { map, Observable } from 'rxjs';
|
||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
import { User } from 'src/app/pages/models/user';
|
import { User } from 'src/app/pages/models/user';
|
||||||
|
import jwt_decode from 'jwt-decode';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@ -12,24 +15,16 @@ export class AuthService {
|
|||||||
private apiUrl: string;
|
private apiUrl: string;
|
||||||
private tokenKey: string;
|
private tokenKey: string;
|
||||||
|
|
||||||
constructor(private http: HttpClient) {
|
constructor(private http: HttpClient, private router: Router) {
|
||||||
// On se sert des variables d'environnement de notre application
|
// On se sert des variables d'environnement de notre application
|
||||||
this.apiUrl = environment.apiUrl;
|
this.apiUrl = environment.apiUrl;
|
||||||
this.tokenKey = environment.tokenKey;
|
this.tokenKey = environment.tokenKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
// signup(): Observable<any> {
|
signup(newUser: User): Observable<any> {
|
||||||
// // const body = {
|
return this.http.post(`${this.apiUrl}/signup`, newUser);
|
||||||
// // firstName: firstName,
|
}
|
||||||
// // lastName: lastName,
|
|
||||||
// // email: email,
|
|
||||||
// // password: password
|
|
||||||
// // };
|
|
||||||
|
|
||||||
// console.log("Mon nouvel utilisateur : ", newUser);
|
|
||||||
|
|
||||||
// return this.http.post(`${this.apiUrl}/register`, newUser);
|
|
||||||
// }
|
|
||||||
|
|
||||||
signin(email: string, password: string): Observable<any> {
|
signin(email: string, password: string): Observable<any> {
|
||||||
const body = {
|
const body = {
|
||||||
@ -37,12 +32,6 @@ export class AuthService {
|
|||||||
password: password
|
password: password
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("Mon body : ", body);
|
|
||||||
|
|
||||||
// Modifier cette partie ci-dessous :
|
|
||||||
// - pour pouvoir stocker dans le localstorage notre accesstoken
|
|
||||||
// - Sous la clé "TOKEN-SIMPLEAT"
|
|
||||||
|
|
||||||
return this.http.post(`${this.apiUrl}/signin`, body).pipe(
|
return this.http.post(`${this.apiUrl}/signin`, body).pipe(
|
||||||
map((x: any) => {
|
map((x: any) => {
|
||||||
console.log(x);
|
console.log(x);
|
||||||
@ -55,15 +44,12 @@ export class AuthService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// forgotPassword(email: string, password: string): Observable<any> {
|
getConnectedUserInfo(): Observable<User> | void {
|
||||||
// const body = {
|
const token = localStorage.getItem(this.tokenKey);
|
||||||
// email: email,
|
if(token) {
|
||||||
// password: password
|
const decodedToken = jwt_decode<any>(token);
|
||||||
// };
|
const userId = decodedToken.userId;
|
||||||
|
return this.http.get<User>(`${this.apiUrl}/user/${userId}`);
|
||||||
// console.log("Mon body : ", body);
|
}
|
||||||
|
}
|
||||||
// return this.http.post(`${this.apiUrl}/forgot-psw`, body);
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ export class TokenService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public destroyToken(): void {
|
public destroyToken(token : any) {
|
||||||
localStorage.removeItem(this.tokenKey);
|
localStorage.removeItem(token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
apiUrl: "http://localhost:8081",
|
apiUrl: "http://localhost:8080",
|
||||||
tokenKey: "TOKEN-SIMPLEAT"
|
tokenKey: "TOKEN-SIMPLEAT"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user