本文整理汇总了TypeScript中app/services/security-service.SecurityService类的典型用法代码示例。如果您正苦于以下问题:TypeScript SecurityService类的具体用法?TypeScript SecurityService怎么用?TypeScript SecurityService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SecurityService类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getLoginData
getLoginData() {
return this.securityService
.getCurrentUserData()
.do((result : Result) => {
this.user = result.data;
});
}
示例2: ngOnInit
ngOnInit(): void {
this.securityService.getCurrentUserData().subscribe((result_user : Result<any>) => {
if(result_user.success) {
this.router.navigateByUrl(result_user.data.default_page_url || '/diary');
} else {
window.location.href=environment.login_url;
}
});
}
示例3: ngOnInit
ngOnInit() {
this.person_changes_subscriber = this.personService.personChanges$
.subscribe(() => {
this.load_members_list();
});
this.contact_changes_subscriber = this.personService.contactChanges$
.subscribe(() => {
this.load_members_list();
});
this.parameterService.getActiveBranches().subscribe((result_branches) => {
this.branches = result_branches.data;
});
this.securityService.getCurrentUserData()
.subscribe((result_user : Result<any>) => {
//this.current_branch = params['branch'] || user.default_branch_id || 0;
});
this.load_members_list();
}
示例4: logout
logout() {
this.user = null;
this.securityService.logout();
}