2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-23 03:20:52 +08:00

修正默认时间挫问题

This commit is contained in:
ctrlcvs 2023-01-14 23:46:04 +08:00
parent f4461f8912
commit 010a3b7714

View File

@ -28,8 +28,8 @@ export async function redisGet(userId, type = 'bbs') {
return JSON.parse(await redis.get(`xiaoyao:${type}:${userId}`)) return JSON.parse(await redis.get(`xiaoyao:${type}:${userId}`))
} }
export async function redisSet(userId="all", type = 'bbs', data, time=0) { export async function redisSet(userId="all", type = 'bbs', data, time=0) {
var time = moment(Date.now()).add('days', 1).format('YYYY-MM-DD 00:00:00') var dayTime = moment(Date.now()).add('days', 1).format('YYYY-MM-DD 00:00:00')
var new_date = (new Date(time).getTime() - new Date().getTime()) / 1000 //获取隔天凌晨的时间差 var new_date = (new Date(dayTime).getTime() - new Date().getTime()) / 1000 //获取隔天凌晨的时间差
if (time!==0) { if (time!==0) {
new_date = time new_date = time
} }