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,KAAKyC,QAAUzC,KAAKwC,QAAU,kBAAoB,4DA1GzCE,GAAWC,kFAAXD,EAAWE,8jBCfxBD,yBAEAA,yBAEEA,kBAEEA,iBAEEA,sBACEA,uBACFA,QAEAA,sBACEA,uBACAA,sBAAsCA,gCAASE,gBAAaF,QAC9DA,QACFA,QAGAA,iBACEA,kBACEA,yBAA2FA,gCAASE,cAAYF,mBAAMA,QACxHA,QAEAA,kBACEA,0BAA6GA,4BAAeA,QAC9HA,QAEFA,QAGFA,QAEFA,eA/BaA,gCAELA,wCASqBA,mDACAA,iCAOuCA,+CAIAA,4QDVvDD,GAAb,KDCO,IAAMI,EAAb,MAAM,sDAAOA,4DAHF,CAACC,cAAsBxD,IACtBwD,QAECD,GAAb,GGOaE,EAAb,MAAM,sDAAOA,4DAXF,CACPC,KACAC,KACAC,KACAL,EACAM,IACAC,SAKSL,GAAb","names":["routes","path","component","constructor","usuarioService","storageService","functionsService","activatedRoute","dataSharingService","this","FormGroup","login","FormControl","Validators","senha","ngOnInit","getUsuarioLogado","setUsuarioLogado","UsuarioDTO","ionViewWillEnter","queryParams","subscribe","param","returnURL","returnUrl","error","doLogin","presentLoading","formLogin","get","value","resp","setToken","headers","usuarioDTO","body","s","perfil","PERFIL","isUserLoggedIn","next","dismissLoading","goToPath","navigate","showAlert","console","log","showErrorAlert","togglePwd","showPwd","pwdIcon","GcLoginPage","i0","selectors","ctx","GcLoginPageRoutingModule","RouterModule","GcLoginPageModule","CommonModule","FormsModule","IonicModule","ComponentsModule","ReactiveFormsModule"],"sources":["./src/app/pages/modulo-gc/controle-acesso/gc-login/gc-login-routing.module.ts","./src/app/pages/modulo-gc/controle-acesso/gc-login/gc-login.page.ts","./src/app/pages/modulo-gc/controle-acesso/gc-login/gc-login.page.html","./src/app/pages/modulo-gc/controle-acesso/gc-login/gc-login.module.ts"],"sourcesContent":["import { NgModule } from '@angular/core';\nimport { Routes, RouterModule } from '@angular/router';\n\nimport { GcLoginPage } from './gc-login.page';\n\nconst routes: Routes = [\n {\n path: '',\n component: GcLoginPage\n }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class GcLoginPageRoutingModule {}\n","import { PERFIL } from '../../../../config/perfil.config';\nimport { DataSharingService } from '../../../../services/common/data-sharing.service';\nimport { ActivatedRoute } from '@angular/router';\nimport { FunctionsService } from '../../../../services/common/functions.service';\nimport { StorageService } from '../../../../services/storage/storage.service';\nimport { UsuarioService } from '../../../../services/usuario/usuario.service';\nimport { UsuarioDTO } from '../../../../models/controle-acesso/usuarioDTO';\nimport { Component, OnInit } from '@angular/core';\nimport { FormControl, FormGroup, Validators } from '@angular/forms';\n\n@Component({\n selector: 'app-gc-login',\n templateUrl: './gc-login.page.html',\n styleUrls: ['./gc-login.page.scss'],\n})\nexport class GcLoginPage implements OnInit {\n\n pwdIcon = \"eye-outline\";\n showPwd = false;\n\n formLogin = new FormGroup({\n login: new FormControl('', [Validators.required, Validators.minLength(5), Validators.maxLength(100)]),\n senha: new FormControl('', [Validators.required, Validators.minLength(5)]),\n \n });\n\n error: any;\n returnURL: string = '';\n\n constructor( private usuarioService: UsuarioService\n , private storageService: StorageService\n , private functionsService: FunctionsService \n , private activatedRoute: ActivatedRoute\n , private dataSharingService: DataSharingService ) { }\n\n ngOnInit() {\n\n if(!this.storageService.getUsuarioLogado()){\n this.storageService.setUsuarioLogado(new UsuarioDTO);\n }\n \n }\n\n ionViewWillEnter(){\n \n \n this.activatedRoute.queryParams.subscribe(\n param=>{\n this.returnURL = param.returnUrl; \n },\n error=>{\n this.returnURL = '';\n });\n \n \n\n }\n\n doLogin(){\n \n this.functionsService.presentLoading('');\n\n this.usuarioService.doLogin( this.formLogin.get('login').value\n , this.formLogin.get('senha').value).subscribe(\n resp => {\n \n //armazena o token\n this.storageService.setToken(resp.headers.get('Authorization'));\n \n let usuarioDTO: UsuarioDTO = new UsuarioDTO();\n usuarioDTO = resp.body;\n \n if( usuarioDTO.perfil !== PERFIL.CANDIDATO ){\n\n //armazena o usuario\n this.storageService.setUsuarioLogado(usuarioDTO);\n \n //informa ao serviço de compartilhamento de dados que o usuário está logado\n this.dataSharingService.isUserLoggedIn.next(true);\n \n this.functionsService.dismissLoading();\n if(this.returnURL){\n this.functionsService.goToPath(this.returnURL); \n }else{\n this.functionsService.navigate('/modulo-gc/gc-funcoes');\n }\n\n }else{\n\n this.functionsService.dismissLoading();\n this.functionsService.showAlert( 'Atenção!'\n , 'Acesso negado!'\n , ['Ok']);\n\n }\n \n \n },\n error => {\n\n //transforma o objeto em string\n //error = JSON.stringify(error);;\n this.functionsService.dismissLoading();\n \n console.log(error);\n //this.functions.dismissLoading();\n \n this.functionsService.showErrorAlert( 'Atenção!'\n , 'Não foi possível fazer login.' \n , error\n , ['Ok']);\n \n \n }); \n \n }\n\n \n\n togglePwd() {\n this.showPwd = !this.showPwd;\n this.pwdIcon = this.showPwd ? \"eye-off-outline\" : \"eye-outline\";\n }\n \n\n}\n","\n\n\n\n
\n \n
\n\n \n \n \n\n \n \n \n \n
\n\n \n
\n
\n Login \n
\n \n
\n Recuperar Senha\n
\n \n
\n\n \n
\n\n
\n","import { ComponentsModule } from '../../../../components/components.module';\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\n\nimport { IonicModule } from '@ionic/angular';\n\nimport { GcLoginPageRoutingModule } from './gc-login-routing.module';\n\nimport { GcLoginPage } from './gc-login.page';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n IonicModule,\n GcLoginPageRoutingModule,\n ComponentsModule,\n ReactiveFormsModule,\n \n ],\n declarations: [GcLoginPage]\n})\nexport class GcLoginPageModule {}\n"],"sourceRoot":"webpack:///","file":"5548.556e66945efb5087.js"}