change class

This commit is contained in:
Peter Maquiran
2023-07-06 13:17:36 +01:00
parent 8db8fa4ea3
commit 10eaf29645
2 changed files with 21 additions and 13 deletions
+15 -7
View File
@@ -1,9 +1,10 @@
import { SHA1 } from 'crypto-js'
import { localstoreService } from './localstore.service'
export class documentManagementStore {
class _DocumentManagementStore {
static session: {
session: {
UserId: number,
Email: string,
UserName: string
@@ -17,20 +18,27 @@ export class documentManagementStore {
AuthorizationJwt: string
}
static get keyName() {
constructor() {
this.session = localstoreService.get(this.keyName, {})
}
get keyName() {
return SHA1("documentManagement").toString()
}
static setData(data) {
setData(data) {
this.session = data
localstoreService.set(this.keyName, {
user: this.session
session: this.session
})
}
static clear() {
clear() {
delete this.session
localstoreService.delete(this.keyName)
}
}
}
export const DocumentManagementStore = new _DocumentManagementStore()