syncSplash 增加 500ms 超时

This commit is contained in:
mx1700 2019-08-25 20:20:54 +08:00
parent 9d92ecc502
commit 9dd9cb782a

View file

@ -118,10 +118,17 @@ async function getSplashByStore() {
}
async function syncSplash() {
const splash = await callV2('GET', '/splash');
await Token.set('splash', JSON.stringify(splash));
let load = (async () => {
const splash = await callV2('GET', '/splash');
await Token.set('splash', JSON.stringify(splash));
return splash;
})();
return splash;
let timer = new Promise((resolve, reject) => {
setTimeout(resolve, 500)
});
return Promise.race([load, timer]);
}
async function getSelfInfo() {