如何在 afterSave 函数中获取解析用户?
Parse.Cloud.afterSave(Parse.User, function(request) {
Parse.Cloud.useMasterKey();
console.log("username: "+request.user.username);
query = new Parse.Query(Parse.User);
query.equalTo("username", request.user.username);
query.first ( {
success: function(object) {
//object.relation("users").add(request.user);
//object.save();
console.log("sucesss"+ object);
},
error: function(error) {
throw "Got an error " + error.code + " : " + error.message;
}
});
});