本文整理汇总了TypeScript中app/core/auth/account.service.AccountService类的典型用法代码示例。如果您正苦于以下问题:TypeScript service.AccountService类的具体用法?TypeScript service.AccountService怎么用?TypeScript service.AccountService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了service.AccountService类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: updateView
private updateView(): void {
const hasAnyAuthority = this.accountService.hasAnyAuthority(this.authorities);
this.viewContainerRef.clear();
if (hasAnyAuthority) {
this.viewContainerRef.createEmbeddedView(this.templateRef);
}
}
示例2: jhiHasAnyAuthority
@Input()
set jhiHasAnyAuthority(value: string | string[]) {
this.authorities = typeof value === 'string' ? [value] : value;
this.updateView();
// Get notified each time authentication state changes.
this.accountService.getAuthenticationState().subscribe(identity => this.updateView());
}
示例3: cb
data => {
this.accountService.identity(true).then(account => {
this.trackerService.sendActivity();
resolve(data);
});
return cb();
},
示例4:
this.authServerProvider.logout().subscribe(null, null, () => this.accountService.authenticate(null));
示例5: cb
data => {
this.accountService.identity(true).then(account => {
resolve(data);
});
return cb();
},
示例6: logout
logout() {
this.authServerProvider.logout().subscribe();
this.accountService.authenticate(null);
}