mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: frontend api (#470) [skip-cache]
This commit is contained in:
1 parent
6d69e88739
commit
96fa6cc7b9
116 files changed
+599
-629
No files matched your search
@@ -46,10 +46,11 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||
// eslint-disable-next-line camelcase
|
||||
try { __webpack_public_path__ = UiContext.cdn_prefix; } catch (e) { }
|
||||
|
||||
const [data] = await Promise.all([
|
||||
(await fetch(`/constant/${UiContext.constantVersion}`, { cache: 'force-cache' })).json(),
|
||||
await import('./modules'),
|
||||
const [data, HydroExports] = await Promise.all([
|
||||
fetch(`/constant/${UiContext.constantVersion}`, { cache: 'force-cache' }).then((r) => r.json()),
|
||||
import('./api'),
|
||||
]);
|
||||
Object.assign(window, { HydroExports });
|
||||
eval(data[0]); // eslint-disable-line no-eval
|
||||
data.shift();
|
||||
window.Hydro.preload = data;
|
||||
|
||||
Reference in new issue
Block a user