syncSplash 增加 500ms 超时

This commit is contained in:
mx1700 2019-08-25 20:29:55 +08:00
parent 9dd9cb782a
commit e65a3a9cf7

View file

@ -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;
})();