import cloud from '@lafjs/cloud' const db = cloud.database(); export default async function (ctx: FunctionContext) { let time = await db.collection("idcount").where({ _id: "69fac1528463a95668c5e5db" }).getOne(); let t = time.data.passcheckTime; if (Date.now() > t + 60 * 24 * 3600000) { const endOfDay: any = new Date(); endOfDay.setHours(0, 0, 0, 0); // 设置为明天的0点,等同于今天的24点 t = endOfDay.getTime(); await db.collection("idcount").where({ _id: "69fac1528463a95668c5e5db" }).update({ passcheckTime: t }); } return { code: 1, data: { time: t }, msg: "成功" } }