Update user object in parse.com

2019-05-19 03:08发布

问题:

how can i update the user object in parse?i know must be logged with the user to modify itself for security reason. This is my code but don't works :POST https://api.parse.com/1/classes/_User/xj3QLLYy07 400 (Bad Request)

      var user = Parse.User.current();
      console.log(user);

      user.save(null, {
      success: function(user) {

      user.set("email", "pty");

      user.save();
      }
       });

回答1:

For the Parse.User object, you need to explicitly set the email address like this (see the API documentation):

var user = Parse.User.current();
user.setEmail("email", options);