From e65a3a9cf78d651faa3d58862688a988284730f3 Mon Sep 17 00:00:00 2001 From: mx1700 Date: Sun, 25 Aug 2019 20:29:55 +0800 Subject: [PATCH] =?UTF-8?q?syncSplash=20=E5=A2=9E=E5=8A=A0=20500ms=20?= =?UTF-8?q?=E8=B6=85=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/util/api.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/util/api.js b/src/util/api.js index 958206e..d38acd4 100644 --- a/src/util/api.js +++ b/src/util/api.js @@ -121,6 +121,14 @@ async function syncSplash() { let load = (async () => { const splash = await callV2('GET', '/splash'); await Token.set('splash', JSON.stringify(splash)); + + const now = Date.parse(new Date()) / 1000; + if((splash.start_time && splash.start_time > now) || + (splash.end_time && now > splash.end_time)) { + + return null; + } + return splash; })();