From 010a3b77146a1044bb7c2fb47cfa1a2c28ab7cd6 Mon Sep 17 00:00:00 2001 From: ctrlcvs <1509167646@qq.com> Date: Sat, 14 Jan 2023 23:46:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=BB=98=E8=AE=A4=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=8C=AB=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/mys/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/mys/utils.js b/model/mys/utils.js index 972cdb0..99647c4 100644 --- a/model/mys/utils.js +++ b/model/mys/utils.js @@ -28,8 +28,8 @@ export async function redisGet(userId, type = 'bbs') { return JSON.parse(await redis.get(`xiaoyao:${type}:${userId}`)) } 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 new_date = (new Date(time).getTime() - new Date().getTime()) / 1000 //获取隔天凌晨的时间差 + var dayTime = moment(Date.now()).add('days', 1).format('YYYY-MM-DD 00:00:00') + var new_date = (new Date(dayTime).getTime() - new Date().getTime()) / 1000 //获取隔天凌晨的时间差 if (time!==0) { new_date = time }