折腾了好几遍一直提示:VM81:1 Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID 53d8b83f-d8f8-11e9-b940-525400dee61a, cloud function service error code -504002, error message errCode: -1 unknown error | errMsg: parameter.data should be object instead of undefined;; at cloud.callFunction api;
求助,各位大神!!谢谢!
云服务器代码
// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()
const db = cloud.database()
const Balancesconn = db.collection('Parea')
exports.main=async(event,context)=>{
return await Balancesconn.add({
Pareacode: "1811893",
Pareaname: "秦淮区"
})
}
云客户端代码
const app = getApp()
const db = wx.cloud.database()
const Balancesconn = db.collection('Parea')
var util = require('../../utils/util.js');
Page({
data: {
motto: 'Hello World',
userInfo: {},
cruserInfo:{},
arr:[],
employee: '',
parea: '',
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo'),
Balancess:[]
},
//事件处理函数
UserAdd: function (e) {
wx.cloud.callFunction({
// 云函数名称
name: 'Balances',
// 传给云函数的参数
})
.then(res => {
console.log(res)
})
.catch(console.error)
}
})
请问:云函数已部署,但针对云数据库需要部署哪些云函数?
除了自己新建的云函数,NPM还要安装哪些必须的云函数?
https://www.nut666.com/bug/23.html这里有个问题描述,不知道能否帮到你
参考下:https://developers.weixin.qq.com/community/search?query=404011&page=1&block=1&random=1568691854817