本文整理匯總了TypeScript中backendless.UserService類的典型用法代碼示例。如果您正苦於以下問題:TypeScript UserService類的具體用法?TypeScript UserService怎麽用?TypeScript UserService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了UserService類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: getLikedPlaceOfUser
getLikedPlaceOfUser(user: Backendless.User) {
var user = user;
var query = new Backendless.DataQuery();
return Backendless.UserService.getCurrentUser()
.then(res=> user=user||res)
.then(()=>query.condition = "user.objectId='" + user.objectId + "'")
.then(()=>Backendless.Data.of(Likes).find(query));
}
示例2: addLike
addLike(place: Place, tag: Tag) {
console.log("tag in addLike:");
console.log(tag);
return Backendless.UserService.getCurrentUser()
.then(user=>{
let like = new Likes(place, user, tag);
return Backendless.Persistence.of(Likes).save(like);
});
}
示例3: logout
logout(){
console.log("current user: " + Backendless.LocalCache.get("current-user-id"));
Backendless.UserService.logout( new Backendless.Async( this.userLogout, this.gotError ) );
}