1.云函数代码
'use strict';
exports.main = async (event, context) => {
//event为客户端上传的参数
console.log('event : ', event)
console.log(context)
return {
event
}
};
2.前端调用代码
submitForm() {
uniCloud.callFunction({
name: 'login',
data: this.formData
}).then(res => {})
}
3.错误提示:
16:53:28.219 [本地调试]Error: 获取本地运行参数失败
16:53:28.226 [本地调试] at f._processResponseFailMessage (D:\app\HBuilderX\plugins\unicloud\share\index.js:1:1397)
16:53:28.227 [本地调试] at process. (D:\app\HBuilderX\plugins\unicloud\share\index.js:1:716)
16:53:28.232 [本地调试] at process.emit (events.js:314:20)
16:53:28.233 [本地调试] at emit (internal/child_process.js:877:12)
16:53:28.236 [本地调试] at processTicksAndRejections (internal/process/task_queues.js:85:21)