0

現在のユーザーのメールは表示できましたが、ユーザー ID を取得するにはどうすればよいですか?

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変数の宣言があり、モデル内にはIDがありますが、電子メールで行ったように実装できませんでしたcurrentUser $: Observable <ApplicationConfiguration.CurrentUser>;ApplicationConfiguration

Ps: 私の英語でごめんなさい

4

2 に答える 2