Page de connexion presque prête. Il manque la redirection de page en fonction du role

This commit is contained in:
MiharyR 2021-10-26 09:11:17 +02:00
parent 0c4142035b
commit fd24009f87
16 changed files with 249 additions and 48 deletions

View file

@ -0,0 +1,43 @@
import { Component, OnInit } from '@angular/core';
import {MessageService} from "../../utils/message/message.service";
import {Router} from "@angular/router";
@Component({
selector: 'app-page-connexion',
templateUrl: './page-connexion.component.html',
styleUrls: ['./page-connexion.component.scss']
})
export class PageConnexionComponent implements OnInit
{
email: string = ""
password: string = ""
constructor( private messageService: MessageService,
private router: Router) { }
ngOnInit(): void {}
onSeConnecter(): void
{
let data = {
"email": this.email,
"password": this.password
};
this.messageService
.sendMessage('connexion', data)
.subscribe( retour => this.maCallback(retour))
}
maCallback(retour): void
{
if(retour.status === "error") console.log(retour.data)
else {
console.log(retour.data)
//this.router.navigateByUrl( '/search' );
}
}
}