我正在使用 Parse js 调用云代码函数
Parse.Cloud.run('enterproductwithid',
{
"token": token,
"objId": objectIdOfCurrentProd,
"username": currentUser1.username
}
而我的云代码函数是:
Parse.Cloud.define("enterproductwithid", function(request, response)
{
console.log(request.params);
});
只传递token参数。没有其他记录。有什么想法可以让我停止拔头发吗?!
谢谢!!
最佳答案
不要将参数键放在引号中。它类似于 $.ajax POST 函数。
Parse.Cloud.run('enterproductwithid',
{
token: token,
objId: objectIdOfCurrentProd,
username: currentUser1.username
},{
success: function(result) {
//do neat stuff
},
error: function(e) {
//error
}
});
关于javascript - 如何正确传递Parse.com Cloud Code参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28162866/