From a908d445bf3fd170cae452aab715413725497594 Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Mon, 22 Dec 2025 12:09:29 +0800 Subject: [PATCH] =?UTF-8?q?chore(=E6=B8=B8=E6=88=8F=E7=8E=8B=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8):=20=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Ranking/GamesKing/index.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/views/Ranking/GamesKing/index.vue b/src/views/Ranking/GamesKing/index.vue index d748264..c6383c1 100644 --- a/src/views/Ranking/GamesKing/index.vue +++ b/src/views/Ranking/GamesKing/index.vue @@ -635,8 +635,7 @@ const showRanking = computed(() => { // 获取对应的时间戳 const getNextMondayInBeijing = () => { const now = new Date() - // 创建一个基于当前时间的新日期对象 - const targetDate = new Date(now.getTime()) + const targetDate = new Date(now.getTime()) // 创建一个基于当前时间的新日期对象 // 转换为北京时间来判断星期几 const utcTime = now.getTime() + now.getTimezoneOffset() * 60000 @@ -652,7 +651,7 @@ const getNextMondayInBeijing = () => { if (normalizedDay === 0) { // 今天是周一 if (beijingHour >= 5) { - daysToAdd = 7 // 下周一 + daysToAdd = 7 // 超过5点,计算到下周一的所需时间 } else { daysToAdd = 0 // 今天 } @@ -661,8 +660,8 @@ const getNextMondayInBeijing = () => { } // 正确地添加天数 - targetDate.setDate(targetDate.getDate() + daysToAdd) - targetDate.setHours(5, 0, 0, 0) // 设置为早上5点 + targetDate.setDate(targetDate.getDate() + daysToAdd) // 添加天数到下周一的当前时间 + targetDate.setHours(5, 0, 0, 0) // 将时间重新设置为早上5点,作为目标时间戳 return targetDate.getTime() }