本文整理匯總了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();
}