@ -1,7 +1,7 @@
import { Component , OnInit } from '@angular/core' ;
import { Component , OnInit , ViewChild } from '@angular/core' ;
import { ElementRef } from '@angular/core' ;
import { ElementRef } from '@angular/core' ;
import { NavController , Platform } from '@ionic/angular' ;
import { NavController , Platform , IonInput } from '@ionic/angular' ;
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service' ;
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service' ;
import { CommonService } from 'src/app/hmg-common/services/common/common.service' ;
import { CommonService } from 'src/app/hmg-common/services/common/common.service' ;
import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service' ;
import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service' ;
@ -48,6 +48,7 @@ export class SmsPageComponent implements OnInit {
public isPostNoLoad = true ;
public isPostNoLoad = true ;
loginType : any ;
loginType : any ;
activeType : any ;
activeType : any ;
@ViewChild ( 'ref' ) inputElement : IonInput ;
constructor (
constructor (
@ -169,7 +170,8 @@ export class SmsPageComponent implements OnInit {
request . activationCode = this . code ; // code;this.activationCode;
request . activationCode = this . code ; // code;this.activationCode;
request . P_USER_NAME = data . P_USER_NAME ;
request . P_USER_NAME = data . P_USER_NAME ;
request . MobileNumber = data . MobileNumber ;
request . MobileNumber = data . MobileNumber ;
this . authService . checkSMS ( request , ( ) = > { } , this . translate . trPK ( 'general' , 'ok' ) ) . subscribe ( ( result : SMSCheckResponse ) = > {
// tslint:disable-next-line: max-line-length
this . authService . checkSMS ( request , ( ) = > { this . restCursorPosition ( ) } , this . translate . trPK ( 'general' , 'ok' ) ) . subscribe ( ( result : SMSCheckResponse ) = > {
if ( this . common . validResponse ( result ) ) {
if ( this . common . validResponse ( result ) ) {
AuthenticationService . servicePrivilage = result . Privilege_List ;
AuthenticationService . servicePrivilage = result . Privilege_List ;
this . authService . setAuthenticatedUser ( result ) . subscribe ( ( ) = > {
this . authService . setAuthenticatedUser ( result ) . subscribe ( ( ) = > {
@ -183,10 +185,19 @@ export class SmsPageComponent implements OnInit {
this . activeType = this . common . setActiveTypeLogin ( 0 ) ;
this . activeType = this . common . setActiveTypeLogin ( 0 ) ;
this . common . openHome ( ) ;
this . common . openHome ( ) ;
} ) ;
} ) ;
} else {
}
}
} ) ;
} ) ;
}
}
public restCursorPosition ( ) {
this . smc_code = [ ] ;
setTimeout ( ( ) = > {
this . inputElement . setFocus ( ) ;
} , 500 )
}
public insertMobileLogin() {
public insertMobileLogin() {
const request = new GetLoginInfoRequest ( ) ;
const request = new GetLoginInfoRequest ( ) ;
this . authService . setPublicFields ( request ) ;
this . authService . setPublicFields ( request ) ;
@ -220,6 +231,9 @@ export class SmsPageComponent implements OnInit {
this . sharedData . setSharedData ( true , Password . IS_EXPIRED_PSW ) ;
this . sharedData . setSharedData ( true , Password . IS_EXPIRED_PSW ) ;
this . common . openChangePassword ( ) ;
this . common . openChangePassword ( ) ;
}
}
} else {
this . smc_code = [ ] ;
}
}
} ) ;
} ) ;
}
}