const db = uniCloud.database(); const _ = db.command; module.exports = { _before: function () { // 通用预处理器 }, async getGiftList() { try { const res = await db.collection("gifts").get(); console.log(res.data); return { code: 200, data: res.data } } catch(e) { console.log(e.message); return { code: 500, msg: e.message } } }, }