Files
2025-03-21 09:38:06 +08:00

25 lines
387 B
JavaScript

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
}
}
},
}