mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
Many changes
Edit event
This commit is contained in:
@@ -34,7 +34,7 @@ export class LoginPage implements OnInit {
|
||||
ngOnInit() {
|
||||
|
||||
}
|
||||
/* Function to validade the login inputs */
|
||||
//Function to validade the login inputs
|
||||
validateInput(){
|
||||
return (
|
||||
this.username.trim().length > 0
|
||||
@@ -60,7 +60,7 @@ export class LoginPage implements OnInit {
|
||||
if(res.data){
|
||||
this.storageService.store(AuthConnstants.AUTH, res.data);
|
||||
console.log('Log RockectChat OK');
|
||||
/* console.log(res.data); */
|
||||
//console.log(res.data);
|
||||
|
||||
}
|
||||
else{
|
||||
@@ -79,6 +79,7 @@ export class LoginPage implements OnInit {
|
||||
async Login(){
|
||||
try {
|
||||
//Go to our home in home/feed.
|
||||
//this.router.navigate(['/home/events']);
|
||||
if(this.validateInput()){
|
||||
this.userattempt = {
|
||||
username: this.username,
|
||||
@@ -86,20 +87,19 @@ export class LoginPage implements OnInit {
|
||||
domainName: environment.domain,
|
||||
BasicAuthKey: ""
|
||||
}
|
||||
if (await this.authService.login(this.userattempt))
|
||||
{
|
||||
if (await this.authService.login(this.userattempt)){
|
||||
this.loginAction();
|
||||
console.log('Log Gabinete Digital OK');
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* this.toastService.presentToast('Não foi possível fazer login"'); */
|
||||
//this.toastService.presentToast('Não foi possível fazer login"');
|
||||
this.presentAlert('O nome de utilizador e palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar.');
|
||||
}
|
||||
}
|
||||
else{
|
||||
/* this.toastService.presentToast('Preencha todos campos'); */
|
||||
//this.toastService.presentToast('Preencha todos campos');
|
||||
this.presentAlert('Por favor, insira o seu nome de utilizador e palavra-passe.');
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user