我有下面的代码工作正常:

  <script type="text/javascript">
Parse.initialize("Lvw6b7TPacv0DX949odBhUPo2nqH5az7SPg6qoiD", "PIuBiR1tGtdJ8IDMnX3yEiljW4V3FQjeoEOhmzEW");

var Recipe = Parse.object.extend("UserSignUp");
var recipe = new Recipe();
  recipe.save({username: "<?php echo $Username  ?>",password: "<?php echo $Password  ?>",title: "<?php echo $Title ?>",name: "<?php echo $Name ?>",email: "<?php echo $Email ?>",summary: "<?php echo $Summary ?>"}, {
  success: function(object) {
    $(".success").show();
  },
  error: function(model, error) {
    $(".error").show();
  }
});



但是,这保存到我创建的usersignup类中。理想情况下,我需要将数据保存到用户安装类中,但是我无法这样做。

如何实现呢?

最佳答案

可以肯定的是,该代码创建了一个UserSignUp(易名为Recipe)并保存了它。 Parse.User的创建方法称为signUp()

the doc:复制

var user = new Parse.User();
user.set("username", "my name");
user.set("password", "my pass");
user.set("email", "email@example.com");

// other fields can be set just like with Parse.Object
user.set("phone", "415-392-0202");

user.signUp(null, {
  success: function(user) {
    // Hooray! Let them use the app now.
  },
  error: function(user, error) {
    // Show the error message somewhere and let the user try again.
    alert("Error: " + error.code + " " + error.message);
  }
});

10-07 19:51
查看更多