iOS 客户端调用函数,参数如下:
func buyTicket(contestId: String, points: Int) -> SignalProducer<Void, Error> {
Functions.functions().httpsCallable("myFunction").call([
"userId": Auth.auth().currentUser!.uid,
"points": points,
"contestId": contestId
], completion: ...
然后在函数的开头我有这个日志
const userId = req.body.data.userId;
const contestId = req.body.data.contestId;
const points = req.body.data.points;
console.log(`myFunction called with userId: ${userId} contestId: ${contestId} points: ${points}`);
打印出来的是
使用 userId 调用的 myFunction:BzoW5pWLbWRnd2UgjnTkfd3xfNf2 竞赛Id:pBsQo0FHMyu4ay18dexy 点:[object Object]
为什么点转换为对象?当我尝试将点传递给时,这导致我的函数崩溃FieldValue.increment
守候你守候我
相关分类