import cloud from '@lafjs/cloud' const db = cloud.database(); import Utils from "@/Utils"; export default async function (ctx: FunctionContext) { let time =await db.collection("idcount").where({ _id:"690c786db30b6944c56be7aa"}).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: "690c786db30b6944c56be7aa" }).update({ passcheckTime:t}); } return{code:1,data:{time:t},msg:"成功"} }