This commit is contained in:
2023-10-26 14:30:34 +07:00
parent b98c2051e9
commit 136c9a2f6d
2 changed files with 4 additions and 6 deletions

View File

@@ -43,11 +43,9 @@ export class LoginComponent implements OnInit {
async onSubmit(form: any) { async onSubmit(form: any) {
if (!form.valid) return false; if (!form.valid) return false;
try { try {
// const result = await lastValueFrom(this.authService.login(this.dataForm)); const result = await lastValueFrom(this.authService.login(this.dataForm));
const cathayResult = await lastValueFrom(this.cathayAuthService.login(this.cathayForm)) // const cathayResult = await lastValueFrom(this.cathayAuthService.login(this.cathayForm))
// this.cathayAuthService.login(this.cathayForm).subscribe(res => console.log(res)) this.appService.setAuth(result);
console.log(cathayResult)
this.appService.setAuth(cathayResult);
return this.router.navigate(['/pages']); return this.router.navigate(['/pages']);
} catch (err) { } catch (err) {
return this.appService.message(EAction.ERROR, EText.NO_DATA); return this.appService.message(EAction.ERROR, EText.NO_DATA);

View File

@@ -14,7 +14,7 @@ import { TokenIntercepterInterceptor } from './intercepter/token-intercepter.int
HttpClientModule, HttpClientModule,
], ],
providers: [ providers: [
{ provide: HTTP_INTERCEPTORS, useClass: TokenIntercepterInterceptor, multi: true }, // { provide: HTTP_INTERCEPTORS, useClass: TokenIntercepterInterceptor, multi: true },
] ]
}) })
export class CoreModule { } export class CoreModule { }