gpt4 book ai didi

javascript - 如何正确传递Parse.com Cloud Code参数?

转载 作者:行者123 更新时间:2023-11-28 19:24:21 24 4
gpt4 key购买 nike

我正在使用 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com