mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
Improve local storage
This commit is contained in:
@@ -38,7 +38,9 @@ export class LoginPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
// clear local storage
|
||||||
|
window.localStorage.clear();
|
||||||
|
|
||||||
// App has session
|
// App has session
|
||||||
if(!this.localstoreService.get('UserData', false)) {
|
if(!this.localstoreService.get('UserData', false)) {
|
||||||
this.hasSession = false
|
this.hasSession = false
|
||||||
|
|||||||
@@ -6,10 +6,11 @@ import { AES, enc, SHA1 } from 'crypto-js'
|
|||||||
})
|
})
|
||||||
export class LocalstoreService {
|
export class LocalstoreService {
|
||||||
|
|
||||||
private prefix = 'v2-'
|
private prefix = 'v0-'
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
const key = SHA1('version').toString()
|
const key = SHA1('version').toString()
|
||||||
|
const version = this.prefix.charAt(1)
|
||||||
|
|
||||||
if(this.get(key, false)) {
|
if(this.get(key, false)) {
|
||||||
// alert('new Update')
|
// alert('new Update')
|
||||||
|
|||||||
Reference in New Issue
Block a user