简而言之,我创建了注册和登录功能。问题是我不希望从默认的User类中检索信息,而是从自定义的User类中检索,但是,我不知道如何更改它。
这是我引用默认类(User)的方式。
$scope.signUp = function(form) {
var user = new Parse.User();
user.set("password", form.password);
user.set("username", form.username);
user.signUp(null, {
success: function(user) {
window.location = 'myprofile.php'
},
error: function(user, error) {
alert("Unable to sign up: " + error.code + " " + error.message);
}
});
};
$scope.logIn = function(form) {
Parse.User.logIn(form.lusername, form.lpassword, {
success: function(user) {
window.location = 'admin.php'
},
error: function(user, error) {
alert("Unable to log in: " + error.code + " " + error.message);
}
});
};
$scope.logOut = function(form) {
Parse.User.logOut();
window.location = 'index.html'
};
}]);