SUPPORT-9324: использую кеш с добавлением id пользователя
This commit is contained in:
parent
c0918a0be7
commit
f045772222
2 changed files with 33 additions and 2 deletions
|
|
@ -7,7 +7,7 @@ import {AgGridModule} from "ag-grid-angular";
|
||||||
import {
|
import {
|
||||||
BpmnModule,
|
BpmnModule,
|
||||||
ComponentsModule,
|
ComponentsModule,
|
||||||
CoreModule,
|
CoreModule, LocalStorageService,
|
||||||
ProgressIndicationService,
|
ProgressIndicationService,
|
||||||
SecurityModule
|
SecurityModule
|
||||||
} from "@webbpm/base-package";
|
} from "@webbpm/base-package";
|
||||||
|
|
@ -26,6 +26,7 @@ import {DropdownTreeviewSelectComponent} from "../../account_applications/compon
|
||||||
import {TreeviewModule} from "ngx-treeview";
|
import {TreeviewModule} from "ngx-treeview";
|
||||||
import {ErvuStaticGrid} from "../../account_applications/component/grid/ErvuStaticGrid";
|
import {ErvuStaticGrid} from "../../account_applications/component/grid/ErvuStaticGrid";
|
||||||
import {AuthorizationService} from "./service/authorization.service";
|
import {AuthorizationService} from "./service/authorization.service";
|
||||||
|
import {UserScopeLocalStorageService} from "./service/user-scope-local-storage.service";
|
||||||
|
|
||||||
registerLocaleData(localeRu);
|
registerLocaleData(localeRu);
|
||||||
export const DIRECTIVES = [
|
export const DIRECTIVES = [
|
||||||
|
|
@ -62,7 +63,14 @@ export const DIRECTIVES = [
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
TokenInterceptor, AuthorizationService,
|
TokenInterceptor, AuthorizationService,
|
||||||
{provide: ProgressIndicationService, useClass: AppProgressIndicationService }
|
{
|
||||||
|
provide: ProgressIndicationService,
|
||||||
|
useClass: AppProgressIndicationService
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provide: LocalStorageService,
|
||||||
|
useClass: UserScopeLocalStorageService
|
||||||
|
}
|
||||||
],
|
],
|
||||||
bootstrap: [],
|
bootstrap: [],
|
||||||
entryComponents: [AppProgressIndicationComponent]
|
entryComponents: [AppProgressIndicationComponent]
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
import {LocalStorageService, WebbpmStorage} from "@webbpm/base-package";
|
||||||
|
import {AuthorizationService} from "./authorization.service";
|
||||||
|
import {Injectable} from "@angular/core";
|
||||||
|
|
||||||
|
@Injectable({providedIn: 'root'})
|
||||||
|
export class UserScopeLocalStorageService extends LocalStorageService {
|
||||||
|
|
||||||
|
constructor(protected authService: AuthorizationService) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
readWebbpmStorage(storageId: string): WebbpmStorage {
|
||||||
|
const userId: string = this.authService.getUserId();
|
||||||
|
const userStorageId = `user_${userId}_${storageId}`;
|
||||||
|
return super.readWebbpmStorage(userStorageId);
|
||||||
|
}
|
||||||
|
|
||||||
|
readTemporalWebbpmStorage(storageId: string): WebbpmStorage {
|
||||||
|
const userId: string = this.authService.getUserId();
|
||||||
|
const userStorageId = `user_${userId}_${storageId}`;
|
||||||
|
return super.readTemporalWebbpmStorage(userStorageId);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue