const now = new Date();
const year = now.getFullYear();
const month = now.getMonth() + 1; // 月份是从0开始的
const day = now.getDate();
//过期时间是每天的23:59:59
let endTime = `${year}-${month}-${day} 23:59:59`
now.setTime(new Date(endTime).getTime())
// 时间转换为 GMT 时区
let tim = now.toGMTString()
//设置cookie
document.cookie = `praise_id_${app.items.fileID}=1;expires=${tim}`
给cookie设置有效期
最新推荐文章于 2024-05-13 08:02:30 发布