4***@qq.com
4***@qq.com
  • 发布:2024-02-26 15:29
  • 更新:2024-02-26 15:29
  • 阅读:33

云函数使用jql报/uni-config-center/uni-id/config.json: Unexpected token / in JSON at position 1101"

分类:uniCloud

报错内容
/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(){}  
                });
2024-02-26 15:29 负责人:无 分享
已邀请:

要回复问题请先登录注册