|
|
|
|
@ -141,7 +141,16 @@ export class LoginComponent implements OnInit, OnDestroy {
|
|
|
|
|
this.empname = localStorage.getItem('emp-name');
|
|
|
|
|
this.logintype = localStorage.getItem('login-type');
|
|
|
|
|
// tslint:disable-next-line: radix
|
|
|
|
|
this.currentLang = parseInt(localStorage.getItem('lang'));
|
|
|
|
|
let isEng = localStorage.getItem('lang')
|
|
|
|
|
if(isEng){
|
|
|
|
|
this.currentLang = 2;
|
|
|
|
|
this.language = "US";
|
|
|
|
|
this.changeLanguage('2')
|
|
|
|
|
}else{
|
|
|
|
|
this.currentLang = 1;
|
|
|
|
|
this.language = "AR";
|
|
|
|
|
this.changeLanguage('1')
|
|
|
|
|
}
|
|
|
|
|
// tslint:disable-next-line: triple-equals
|
|
|
|
|
if (remember == 'true') { this.remeberMe = true; } else { this.remeberMe = false; }
|
|
|
|
|
}
|
|
|
|
|
@ -186,7 +195,13 @@ export class LoginComponent implements OnInit, OnDestroy {
|
|
|
|
|
public remeberMyInfo() {
|
|
|
|
|
if (this.username) {localStorage.setItem('user', this.username); }
|
|
|
|
|
if (this.password) {localStorage.setItem('password', this.password); }
|
|
|
|
|
if (this.currentLang) {localStorage.setItem('lang', this.currentLang.toString()); }
|
|
|
|
|
if (this.currentLang) {
|
|
|
|
|
if(this.currentLang === 1){
|
|
|
|
|
localStorage.setItem('lang', 'ar');
|
|
|
|
|
}else{
|
|
|
|
|
localStorage.setItem('lang', 'en');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
localStorage.setItem('remember', 'true');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -359,7 +374,7 @@ export class LoginComponent implements OnInit, OnDestroy {
|
|
|
|
|
let anotherUser = this.sharedData.getSharedData('anotherUser');
|
|
|
|
|
if(anotherUser){
|
|
|
|
|
this.username = '';
|
|
|
|
|
this.password = '';
|
|
|
|
|
this.password = '';
|
|
|
|
|
}
|
|
|
|
|
console.log('login emit');
|
|
|
|
|
console.log('login');
|
|
|
|
|
|