You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

22 lines
523 B

// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
}) // 使用当前云环境
// 获取云数据库对象
const db = cloud.database()
// 云函数入口函数
exports.main = async (event, context) => {
// 获取OPENID
const openID = cloud.getWXContext().OPENID;
// 查看当前用户的所有待办数据
const fetchResult = await db.collection('todo').where({
_openid: openID,
checked: false,
}).get();
return {
fetchResult,
}
}