1***@qq.com
1***@qq.com
  • 发布:2024-06-06 09:15
  • 更新:2024-06-06 20:04
  • 阅读:157

无法获取云函数内容,上传云端也无法获取。云函数是没问题的

分类:uniCloud

无法获取云函数内容,上传云端也无法获取。云函数是没问题的

exports.main = async (event, context) => {  
  const db = uniCloud.database();  
  const collection = db.collection('app');  

  try {  
    const res = await collection.field({  
      Url: true,  
      description: true,  
      icon: true,  
      name: true,  
      tutorial: true  
    }).get();  

    return {  
      code: 200,  
      data: res.data,  
      message: '获取数据成功'  
    };  
  } catch (err) {  
    return {  
      code: -1,  
      message: '获取数据失败',  
      error: err  
    };  
  }  
};  
2024-06-06 09:15 负责人:无 分享
已邀请:
唐家三少

唐家三少 - 我要写代码

什么叫无法获取云函数内容?

没拿到响应值?通过chrome控制台,查看一下网络请求,看看是否有报错。

要回复问题请先登录注册