本文整理匯總了TypeScript中ng2-ui-auth.AuthService.getPayload方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript AuthService.getPayload方法的具體用法?TypeScript AuthService.getPayload怎麽用?TypeScript AuthService.getPayload使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ng2-ui-auth.AuthService
的用法示例。
在下文中一共展示了AuthService.getPayload方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: isClientRole
isClientRole() {
if (this.auth.getPayload().data.role_id == 10) {
return true;
} else {
return false;
}
}
示例2: getUserDetails
getUserDetails() {
var userDetails = this.auth.getPayload();
if (typeof userDetails !== 'undefined') {
this.user = userDetails.data;
} else {
return false;
}
}
示例3:
complete: () => {
this.expiration = this.auth.getExpirationDate();
this.user = this.auth.getPayload();
}
示例4: ngOnInit
ngOnInit() {
this.user = this.auth.getPayload();
this.expiration = this.auth.getExpirationDate();
this.secret = this.http.get('/secret').map(response => response.text());
}
示例5: getUserRole
getUserRole() {
// if (typeof this.user == 'undefined') {
// this.getUserDetails();
// }
return this.auth.getPayload().data.role_id;
}
示例6: getUserName
getUserName() {
// if (typeof this.user == 'undefined') {
// this.getUserDetails();
// }
return this.auth.getPayload().data.username;
}
示例7: ngOnInit
ngOnInit() {
this.user = this.auth.getPayload();
this.expiration = this.auth.getExpirationDate();
}