Мне удалось отобразить адрес электронной почты текущего пользователя, но как мне получить идентификатор пользователя?
Template:
<div *ngIf="!hasLoggedIn">
{{ (profile$ | async)?.email }}
</div>
TypeScript:
import { Profile, GetProfile, ProfileState, } from '@abp/ng.core';
export class Component implements OnInit {
@Select(ProfileState.getProfile) //State
profile$: Observable<Profile.Response>; //Model
get hasLoggedIn(): boolean {
return this.oAuthService.hasValidAccessToken();
}
constructor(private oAuthService: OAuthService) {}
ngOnInit() {
this.store.dispatch(new GetProfile()).subscribe(); //Action
}
}
Внутри app-routing.module.ts
есть импорт ApplicationLayoutComponent
, а внутри есть объявление переменная currentUser $: Observable <ApplicationConfiguration.CurrentUser>;
, которая используется для отображения имени пользователя в панели навигации, а внутри моделей ApplicationConfiguration
есть идентификатор, но я не смог реализовать его, как я сделал с электронной почтой
Ps: извините для моего английского sh ?