mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: feat: blog
This commit is contained in:
1 parent
f43c1bc8c9
commit
79aca189d1
10 files changed
+36
-31
No files matched your search
@@ -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);
|
||||
Reference in new issue
Block a user