2023-07-06 13:01:51 +01:00
|
|
|
import { SHA1 } from 'crypto-js'
|
|
|
|
|
import { localstoreService } from './localstore.service'
|
|
|
|
|
|
2023-07-06 13:17:36 +01:00
|
|
|
class _DocumentManagementStore {
|
2023-07-06 13:01:51 +01:00
|
|
|
|
2023-07-06 13:17:36 +01:00
|
|
|
|
|
|
|
|
session: {
|
2023-07-06 13:01:51 +01:00
|
|
|
UserId: number,
|
|
|
|
|
Email: string,
|
|
|
|
|
UserName: string
|
|
|
|
|
FullName: string
|
|
|
|
|
RoleID: number
|
|
|
|
|
RoleDescription: string
|
|
|
|
|
OrganicEntityID: number
|
|
|
|
|
OrganicEntityName: string
|
|
|
|
|
Status: string
|
|
|
|
|
Authorization: string
|
|
|
|
|
AuthorizationJwt: string
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-06 13:17:36 +01:00
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
|
this.session = localstoreService.get(this.keyName, {})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get keyName() {
|
2023-07-06 13:01:51 +01:00
|
|
|
return SHA1("documentManagement").toString()
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-06 13:17:36 +01:00
|
|
|
setData(data) {
|
2023-07-06 13:01:51 +01:00
|
|
|
this.session = data
|
|
|
|
|
localstoreService.set(this.keyName, {
|
2023-07-06 13:17:36 +01:00
|
|
|
session: this.session
|
2023-07-06 13:01:51 +01:00
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-06 13:17:36 +01:00
|
|
|
clear() {
|
2023-07-06 13:01:51 +01:00
|
|
|
delete this.session
|
|
|
|
|
localstoreService.delete(this.keyName)
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-06 13:17:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const DocumentManagementStore = new _DocumentManagementStore()
|