pin reset

This commit is contained in:
gayathri1990 2020-12-30 15:11:17 +05:30
parent cf07341ebb
commit 422e3829fb
12 changed files with 64 additions and 26 deletions

View File

@ -11,6 +11,7 @@ import { AwsServiceProvider } from '../../providers/aws-service/aws-service';
import { LoadingProvider } from '../../providers/common-provider/loading'; import { LoadingProvider } from '../../providers/common-provider/loading';
import { ConstantsProvider } from '../../providers/constants/constants'; import { ConstantsProvider } from '../../providers/constants/constants';
import { SalesPDlistPage } from '../sales_pd/pages/sales-p-dlist/sales-p-dlist'; import { SalesPDlistPage } from '../sales_pd/pages/sales-p-dlist/sales-p-dlist';
import { LoginPage } from '../login/login';
/** /**
* Generated class for the AuthPage page. * Generated class for the AuthPage page.
* *
@ -28,11 +29,16 @@ export class AuthPage {
pinAccess: any; pinAccess: any;
newpindetails: any; newpindetails: any;
userDetails: any; userDetails: any;
pin:any;
resetlogin:any;
pinreset: Boolean=true;
pin:any;
mpinaccess:boolean =false; mpinaccess:boolean =false;
newpassword:any; newpassword:any;
ConfirmPassword:any; ConfirmPassword:any;
isPinReset: boolean; isPinReset: boolean;
resetpin:boolean;
constructor(public navCtrl: NavController, public navParams: NavParams,public Menu:MenuController,public fb:FormBuilder,public shared:CognitoServiceProvider,public toast:ToastProvider,public faio:FingerprintAIO,public aws:AwsServiceProvider,public loadingCtrl:LoadingProvider,public commonconstant:ConstantsProvider) { constructor(public navCtrl: NavController, public navParams: NavParams,public Menu:MenuController,public fb:FormBuilder,public shared:CognitoServiceProvider,public toast:ToastProvider,public faio:FingerprintAIO,public aws:AwsServiceProvider,public loadingCtrl:LoadingProvider,public commonconstant:ConstantsProvider) {
let pinLockImage = localStorage.getItem('pinLockImage') let pinLockImage = localStorage.getItem('pinLockImage')
@ -66,15 +72,26 @@ pin:any;
} }
getuserDetails() getuserDetails()
{ {
this.loadingCtrl.pdloader('loading...');
this.loadingCtrl.pdloader('loading...');
let userid = this.aws.getlocale(); let userid = this.aws.getlocale();
this.aws.getuserprofile(userid).subscribe(res=>{ this.aws.getuserprofile(userid).subscribe(res=>{
this.userDetails = res; this.userDetails = res;
if(this.userDetails.dataStatus == true) if(this.userDetails.dataStatus == true)
{ {
this.loadingCtrl.loading.dismiss(); this.loadingCtrl.loading.dismiss();
this.userDetails = this.userDetails.records; this.userDetails = this.userDetails.records;
this.resetpin=this.navParams.get('resetpin');
if(this.resetpin==true)
{
this.mpinaccess = true
this.isPinReset = true
return
}
//localStorage.setItem('userDetails',JSON.stringify(this.userDetails[0])); //localStorage.setItem('userDetails',JSON.stringify(this.userDetails[0]));
if(this.userDetails[0].mpin ==null) if(this.userDetails[0].mpin ==null)
{ {
@ -93,12 +110,23 @@ pin:any;
//console.log(this.mpinaccess); //console.log(this.mpinaccess);
}); });
} }
ngOnInit(){
//this.mpinaccess = true
// this.isPinReset = true
}
resetPin() { resetPin() {
this.isPinReset = true
this.mpinaccess = true this.navCtrl.setRoot(LoginPage,{'resetlogin':this.pinreset});
} }
goBack() { goBack() {
this.isPinReset = false this.isPinReset = false
this.mpinaccess = false this.mpinaccess = false
} }
@ -135,11 +163,13 @@ pin:any;
this.toast.lenderappmessage("Pin Reset Successfully") this.toast.lenderappmessage("Pin Reset Successfully")
this.userDetails[0].mpin = newpin.value this.userDetails[0].mpin = newpin.value
this.mpinaccess = false this.mpinaccess = false
// alert('gotologinpage');
// this.navCtrl.setRoot(LoginPage,{'resetlogin':this.pinreset});
} }
else{ else{
let role=this.commonconstant.takeDecisionRouting(this.userDetails[0]) let role=this.commonconstant.takeDecisionRouting(this.userDetails[0])
if(role == 'sales'){ if(role == 'sales'){
this.navCtrl.setRoot(SalesPDlistPage); this.navCtrl.setRoot(SalesPDlistPage,{'userDetails':this.userDetails});
} }
else{ else{
this.navCtrl.setRoot(PdListPage,{'userDetails':this.userDetails}); this.navCtrl.setRoot(PdListPage,{'userDetails':this.userDetails});

View File

@ -36,7 +36,7 @@
</mat-form-field> </mat-form-field>
<ion-row> <ion-row>
<ion-col text-center> <ion-col text-center>
<button color="primary" mat-raised-button>SIGN IN</button><br/> <button color="primary" mat-raised-button>SIGN IN</button><br/>
<br/></ion-col> <br/></ion-col>
</ion-row> </ion-row>
<!-- <div (click)="fingerprint()" style="font-size:20px;"><ion-icon name="md-finger-print"></ion-icon></div> --> <!-- <div (click)="fingerprint()" style="font-size:20px;"><ion-icon name="md-finger-print"></ion-icon></div> -->

View File

@ -22,6 +22,7 @@ import { ConstantsProvider } from '../../providers/constants/constants';
import { SalesPDlistPage } from '../sales_pd/pages/sales-p-dlist/sales-p-dlist'; import { SalesPDlistPage } from '../sales_pd/pages/sales-p-dlist/sales-p-dlist';
import { PdtriggerProvider } from '../../providers/pdtrigger/pdtrigger'; import { PdtriggerProvider } from '../../providers/pdtrigger/pdtrigger';
import { SalesPdProvider } from '../sales_pd/providers/sales-pd/sales-pd'; import { SalesPdProvider } from '../sales_pd/providers/sales-pd/sales-pd';
import { AuthPage } from '../auth/auth';
@Component({ @Component({
@ -50,12 +51,14 @@ config: MatDialogConfig = {
}; };
userDetails: any; userDetails: any;
commonDetails: any; commonDetails: any;
constructor( public aws: AwsServiceProvider, public dialog: MatDialog, forgetpin: boolean = false;
constructor( public aws: AwsServiceProvider, public dialog: MatDialog, public navParams: NavParams,
public shared:CognitoServiceProvider,public navCtrl:NavController,public Menu:MenuController public shared:CognitoServiceProvider,public navCtrl:NavController,public Menu:MenuController
,public toast:ToastProvider,public load:LoadingController,private events:Events,private constantProvider:ConstantsProvider,private pdtrigger:PdtriggerProvider,private salesPDProvider:SalesPdProvider) { ,public toast:ToastProvider,public load:LoadingController,private events:Events,private constantProvider:ConstantsProvider,private pdtrigger:PdtriggerProvider,private salesPDProvider:SalesPdProvider) {
} }
ngOnInit(){ ngOnInit(){
//this.loggedInCheck(); //this.loggedInCheck();
} }
@ -77,8 +80,9 @@ presentLoading() {
dismissOnPageChange: true dismissOnPageChange: true
}).present(); }).present();
} }
login() { login()
// console.log(this.email); {
if(this.email !==undefined && this.password !==undefined && this.email !='' && this.password !='' && this.email !=null && this.password !=null ){ if(this.email !==undefined && this.password !==undefined && this.email !='' && this.password !='' && this.email !=null && this.password !=null ){
let auth = { 'Username': this.email, 'Password': this.password }; let auth = { 'Username': this.email, 'Password': this.password };
@ -139,7 +143,12 @@ getlenderpddetails()
localStorage.setItem("user_details",JSON.stringify( this.userDetails)); localStorage.setItem("user_details",JSON.stringify( this.userDetails));
this.events.publish(('len_user_name'),this.userDetails); this.events.publish(('len_user_name'),this.userDetails);
let role= this.constantProvider.takeDecisionRouting(this.userDetails) let role= this.constantProvider.takeDecisionRouting(this.userDetails)
if(role == 'sales'){ this.forgetpin=this.navParams.get('resetlogin');
if( this.forgetpin==true)
{
this.navCtrl.setRoot(AuthPage,{'resetpin':this.forgetpin});
}
else if(role == 'sales'){
this.pdtrigger.initiateMasterApis('sales') this.pdtrigger.initiateMasterApis('sales')
this.navCtrl.setRoot(SalesPDlistPage); this.navCtrl.setRoot(SalesPDlistPage);
@ -181,7 +190,7 @@ forgotopen() {
forgotpassword() { forgotpassword() {
alert('rets');
let auth = { 'Username': this.email }; let auth = { 'Username': this.email };
console.log(auth); console.log(auth);
this.aws.userforgotpass(auth).subscribe(res => { this.aws.userforgotpass(auth).subscribe(res => {

View File

@ -307,6 +307,7 @@ export class SectionListPage {
} }
goto(section_id){ goto(section_id){
alert(section_id);
// this.SalesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj.sales_pd_id).then(()=>{ // this.SalesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj.sales_pd_id).then(()=>{
// localStorage.setItem('product_id_salesPD',value_obj.product_id) // localStorage.setItem('product_id_salesPD',value_obj.product_id)
if(this.sales_pd_id == null && section_id != '1'){ if(this.sales_pd_id == null && section_id != '1'){

View File

@ -43,7 +43,7 @@ current_section:any;
console.log(this.platform.is('cordova')) console.log(this.platform.is('cordova'))
let api_properties = {method:'post', api_name:this.apiUrl+'loadSalesPDTemplate',params : params} let api_properties = {method:'post', api_name:this.apiUrl+'loadSalesPDTemplate',params : params}
if(!this.platform.is('cordova')) { if(!this.platform.is('cordova')) {
// api_properties = {method:'get', api_name:`assets/data/sales_pd_templates/${product_id}.json`,params : params} api_properties = {method:'get', api_name:`assets/data/sales_pd_templates/${product_id}.json`,params : params}
} }
return this.http[api_properties.method](api_properties.api_name,api_properties.params).subscribe(result=>{ return this.http[api_properties.method](api_properties.api_name,api_properties.params).subscribe(result=>{
if(!this.platform.is('cordova') && !result.hasOwnProperty('dataStatus')) { if(!this.platform.is('cordova') && !result.hasOwnProperty('dataStatus')) {

View File

@ -102,6 +102,7 @@ apiurl:any;
} }
userforgotpass(auth) { userforgotpass(auth) {
////(auth); ////(auth);
alert('test');
const userData = { const userData = {
Username: auth.Username, Username: auth.Username,
Pool: lenderUserPool Pool: lenderUserPool

View File

@ -1,9 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" dir="ltr"> <html lang="en" dir="ltr">
<head> <head>
<script data-ionic="inject">
(function(w){var i=w.Ionic=w.Ionic||{};i.version='3.9.2';i.angular='5.0.3';i.staticDir='build/';})(window);
</script>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Ionic App</title> <title>Ionic App</title>
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">