本文整理匯總了TypeScript中parse.Parse.User類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Parse.User類的具體用法?TypeScript Parse.User怎麽用?TypeScript Parse.User使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Parse.User類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: signup
signup(username: String, password: String, success: ()=>void)
{
var user = new Parse.User();
user.set("username", username);
user.set("password", password);
user.signUp().then(function(){
success();
}, function(e){
console.log("Signin failed through email");
});
}
示例2: logIn
logIn(username: String, password: String, success: ()=> void, error: ()=>void)
{
Parse.User.logIn(username, password).then(function(){
success();
},function(e){
error();
});
}
示例3: redirectPageOnUserState
redirectPageOnUserState() {
var currentUser = Parse.User.current();
// console.log("aa", currentUser);
// console.log('this.rootPage:' + this.rootPage)
if (currentUser) {
// console.log("oo", currentUser);
this.rootPage = TabsPage;
} else {
// console.log('Set to login page')
this.rootPage = LoginPage;
// this.rootPage = PropertyTypePage;
}
}
示例4: logout
logout() {
Parse.User.logOut();
this.router.parent.navigate('/login');
}