core: feat: blog

This commit is contained in:
undefined committed 2021-12-19 20:55:48 +08:00
1 parent f43c1bc8c9
commit 79aca189d1
10 files changed
+36 -31

No files matched your search

+9 -11
View File
@@ -20,7 +20,7 @@ console.log(
`,
);
document.addEventListener('DOMContentLoaded', () => {
document.addEventListener('DOMContentLoaded', async () => {
window.UiContext = JSON.parse(window.UiContext);
// eslint-disable-next-line camelcase
@@ -32,16 +32,14 @@ document.addEventListener('DOMContentLoaded', () => {
eval(payload[0]); // eslint-disable-line no-eval
payload.shift();
window.Hydro.preload = payload;
import('./hydro');
} else {
fetch(`/constant?version=${UiContext.constantVersion}`)
.then((res) => res.json())
.then((data) => {
eval(data.payload[0]); // eslint-disable-line no-eval
localStorage.setItem('hydro-constant', JSON.stringify(data));
data.payload.shift();
window.Hydro.preload = data.payload;
import('./hydro');
});
const res = await fetch(`/constant?version=${UiContext.constantVersion}`);
const data = await res.json();
eval(data.payload[0]); // eslint-disable-line no-eval
localStorage.setItem('hydro-constant', JSON.stringify(data));
data.payload.shift();
window.Hydro.preload = data.payload;
}
import('./hydro');
}, false);