报错内容
/tmp/function/@common_modules/uni-id-common/node_modules/uni-config-center/uni-id/config.json: Unexpected token / in JSON at position 1101">
'use strict';
exports.main = async (event, context) => {
const {
action
} = event
const db = uniCloud.databaseForJQL({ // 获取JQL database引用,此处需要传入云函数的event和context,必传
event,
context
})
if (action === 'register') {
let {
userInfo
} = event
let res = await db.collection('user').add(userInfo)
return userInfo
}
}
};
// 使用
let userInfo = {userName: 'aaa'}
uniCloud.callFunction({
name: 'login',
data: {userInfo, action: 'register'},
success(){},
fail(){},
complete(){}
});