Переглянути джерело

default login page

tags/2.037
Patrick Sun 5 роки тому
джерело
коміт
b7a2a0a8bf
1 змінених файлів з 12 додано та 11 видалено
  1. +12
    -11
      src/app/auth/auth.component.ts

+ 12
- 11
src/app/auth/auth.component.ts Переглянути файл

@@ -24,14 +24,7 @@ export class AuthComponent implements OnInit, OnDestroy{

ngOnInit(): void {
this.loginSub = this.authService.loginSuccess.subscribe(
(ok :boolean ) =>{
this.loading = false
console.log (" found login success " + ok );
if (ok)
this.rounter.navigate(["/dashboard"]);
else
this.show();
}
(ok:boolean) =>{this.onLogin(ok)}
);
}

@@ -46,15 +39,23 @@ export class AuthComponent implements OnInit, OnDestroy{

}

public onLogin(ok:boolean) {
this.loading = false
console.log (" found login success " + ok );
if (ok)
this.rounter.navigate(["/dashboard"]);
else
this.show();
}

public show(): void {
this.notificationService.show({
content: 'Your loggin is failed, please try again.',
cssClass: 'button-notification',
animation: { type: 'slide', duration: 400 },
position: { horizontal: 'center', vertical: 'bottom' },
position: { horizontal: 'center', vertical: 'top' },
type: { style: 'error', icon: true },
closable: true
hideAfter : 2000
});
}
}
}

Завантаження…
Відмінити
Зберегти