mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<ion-content class="text-white">
|
<ion-content class="text-white">
|
||||||
<div class="wrapper" *ngIf="pin ==false">
|
<div class="wrapper" *ngIf="userLoginPreference != 'pin' && userLoginPreference != 'fingerprint' && !setPint">
|
||||||
<div class="div-logo">
|
<div class="div-logo">
|
||||||
<img src='assets/images/logo-no-bg.png' alt='logo'>
|
<img src='assets/images/logo-no-bg.png' alt='logo'>
|
||||||
</div>
|
</div>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="main-content height-100" *ngIf="pin">
|
<div class="main-content height-100" *ngIf="userLoginPreference == 'pin' || setPint">
|
||||||
<div class=" align-center justify-center">
|
<div class=" align-center justify-center">
|
||||||
<div class="div-top-header">
|
<div class="div-top-header">
|
||||||
|
|
||||||
@@ -55,9 +55,14 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="voltar d-flex align-center justify-center pt-25 clear" (click)="pin=!pin">
|
<div *ngIf="!setPint" class="voltar d-flex align-center justify-center pt-25 clear" (click)="pin=!pin">
|
||||||
Voltar
|
Entrar com senha
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="setPint" class="voltar d-flex align-center justify-center pt-25 clear" (click)="pin=!pin">
|
||||||
|
Limpar
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ export class LoginPage implements OnInit {
|
|||||||
|
|
||||||
pin = localStorage.getItem('PIN') != null
|
pin = localStorage.getItem('PIN') != null
|
||||||
|
|
||||||
|
userLoginPreference: any
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private http: HttpClient,
|
private http: HttpClient,
|
||||||
private notificatinsservice: NotificationsService,
|
private notificatinsservice: NotificationsService,
|
||||||
@@ -48,7 +50,17 @@ export class LoginPage implements OnInit {
|
|||||||
public alertController: AlertController,
|
public alertController: AlertController,
|
||||||
private modalController: ModalController
|
private modalController: ModalController
|
||||||
//private fcm: FCM
|
//private fcm: FCM
|
||||||
) { }
|
) {
|
||||||
|
|
||||||
|
let userData = JSON.parse(localStorage.getItem('UserData')) || {}
|
||||||
|
|
||||||
|
if (userData.hasOwnProperty('loginPreference')) {
|
||||||
|
this.userLoginPreference = userData.loginPreference
|
||||||
|
} else {
|
||||||
|
this.userLoginPreference = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {}
|
ngOnInit() {}
|
||||||
|
|
||||||
@@ -60,6 +72,7 @@ export class LoginPage implements OnInit {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async presentAlert(message: string) {
|
async presentAlert(message: string) {
|
||||||
const alert = await this.alertController.create({
|
const alert = await this.alertController.create({
|
||||||
cssClass: 'my-custom-class',
|
cssClass: 'my-custom-class',
|
||||||
@@ -125,6 +138,8 @@ export class LoginPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setCode(code: string) {
|
setCode(code: string) {
|
||||||
|
|
||||||
|
|
||||||
if(this.code.length < 4) {
|
if(this.code.length < 4) {
|
||||||
this.code.push(code)
|
this.code.push(code)
|
||||||
}
|
}
|
||||||
@@ -163,6 +178,7 @@ export class LoginPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
storePin() {
|
storePin() {
|
||||||
|
|
||||||
const code = this.code.join('')
|
const code = this.code.join('')
|
||||||
const encrypted = crypto.SHA1(code)
|
const encrypted = crypto.SHA1(code)
|
||||||
|
|
||||||
|
|||||||
@@ -29,15 +29,16 @@
|
|||||||
|
|
||||||
<ion-row>
|
<ion-row>
|
||||||
<ion-col class="align-center d-flex">
|
<ion-col class="align-center d-flex">
|
||||||
<div (click)="addPin()" class="d-flex align-center">
|
<div class="d-flex align-center" (click)="LoginPreferenceMethod('pin')">
|
||||||
<ion-checkbox class="checkBox"></ion-checkbox>
|
<!-- -->
|
||||||
|
<ion-checkbox [checked]="userLoginPreference=='pin' " class="checkBox" ></ion-checkbox>
|
||||||
PIN
|
PIN
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</ion-col>
|
</ion-col>
|
||||||
<ion-col class="align-center d-flex">
|
<ion-col class="align-center d-flex">
|
||||||
<div (click)="addFingerprint()" class="d-flex align-center">
|
<div (click)="addFingerprint()" class="d-flex align-center">
|
||||||
<ion-checkbox class="checkBox"></ion-checkbox>
|
<ion-checkbox class="checkBox" [checked]="false"></ion-checkbox>
|
||||||
Impressão Digital
|
Impressão Digital
|
||||||
</div>
|
</div>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
@@ -46,22 +47,25 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-center mt-10">
|
||||||
|
<ion-buttons slot="start" class="buttonSize" (click)="logout()" >
|
||||||
|
<ion-button class="btn-cancel buttonSize" fill="clear" style="background:#ffe0e0;" >
|
||||||
|
<ion-label style="color:#d30a0a;">Terminar sessão</ion-label>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-center mt-10">
|
||||||
|
<ion-button (click)="addPin()" class="btn-ok buttonSize" fill="clear" color="#fff" >
|
||||||
|
<ion-label>Alterar PIN</ion-label>
|
||||||
|
</ion-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<ion-footer class=" footer-container ion-no-border bg-blue">
|
<ion-footer class=" footer-container ion-no-border bg-blue">
|
||||||
|
|
||||||
<div class="d-flex justify-center mb-10">
|
|
||||||
<ion-buttons slot="start" (click)="logout()">
|
|
||||||
<ion-button class="btn-cancel" fill="clear"style="background:#ffe0e0;" >
|
|
||||||
<ion-label style="color:#d30a0a;">Terminar sessão</ion-label>
|
|
||||||
</ion-button>
|
|
||||||
</ion-buttons>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="d-flex justify-space-between">
|
<div class="d-flex justify-space-between">
|
||||||
|
|
||||||
<ion-buttons slot="start" (click)="close()">
|
<ion-buttons slot="start" (click)="close()">
|
||||||
@@ -74,7 +78,6 @@
|
|||||||
<ion-label>Gravar</ion-label>
|
<ion-label>Gravar</ion-label>
|
||||||
</ion-button>
|
</ion-button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</ion-footer>
|
</ion-footer>
|
||||||
@@ -57,4 +57,8 @@
|
|||||||
.checkBox{
|
.checkBox{
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttonSize {
|
||||||
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
@@ -110,5 +110,37 @@ export class ProfileComponent implements OnInit {
|
|||||||
this.router.navigate(['/']);
|
this.router.navigate(['/']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LoginPreferenceMethod(type: string) {
|
||||||
|
|
||||||
|
let userData = JSON.parse(localStorage.getItem('UserData')) || {}
|
||||||
|
|
||||||
|
if (userData.hasOwnProperty('loginPreference')) {
|
||||||
|
if (userData.loginPreference != type) {
|
||||||
|
if (type) {
|
||||||
|
userData.loginPreference = type
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
userData.loginPreference = 'none'
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
userData.loginPreference = 'none'
|
||||||
|
}
|
||||||
|
|
||||||
|
localStorage.setItem('UserData', JSON.stringify(userData) )
|
||||||
|
}
|
||||||
|
|
||||||
|
get userLoginPreference() {
|
||||||
|
|
||||||
|
let userData = JSON.parse(localStorage.getItem('UserData')) || {}
|
||||||
|
|
||||||
|
if (userData.hasOwnProperty('loginPreference')) {
|
||||||
|
console.log( userData.loginPreference)
|
||||||
|
return userData.loginPreference
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div (click)="close()" class="d-flex align-center justify-center pt-25 clear">
|
<div (click)="close()" class="d-flex align-center justify-center pt-25 clear">
|
||||||
Voltar
|
Cancelar
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user