import { Injectable } from '@angular/core' ; import { HttpClient } from '@angular/common/http' ; import { FullscreenLoading } from '../shared/decorator/fullscreen-loading.decorator' ; import { Observable } from 'rxjs' ; import { IBaseResponse , ILoginRequest , ILoginVerify } from '../app.interface' ; import { environment } from '../../environments/environment' ; @ Injectable ( ) export class AuthService { constructor ( private http ) { } @ FullscreenLoading ( ) request ( account , otp ) { return this . http . post < IBaseResponse < ILoginRequest > > ( `${ environment . baseUrl }/auth/step/one` , { account , otp } ) ; } @ FullscreenLoading ( ) verify ( guid , tempId , account , code , otp ) { return this . http . post < IBaseResponse < ILoginVerify > > ( `${ environment . baseUrl }/auth/step/two` , { guid , tempId , account , code , otp } ) ; } @ FullscreenLoading ( ) logout ( ) { return this . http . post < IBaseResponse < null > > ( `${ environment . baseUrl }/auth/logout` , { } ) ; } }