mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-30 15:31:49 +08:00
This commit is contained in:
1 parent
73d6cc1b41
commit
e60ad5d6c2
5 files changed
+119
-66
No files matched your search
@@ -106,12 +106,12 @@ async function updateBundle(meta) {
|
||||
const resources = await Promise.all(ASSETS.map(async (url) => {
|
||||
const response = await fetch(new Request(url, { cache: "no-store" }));
|
||||
if (!response.ok || response.redirected) {
|
||||
throw new Error("应用资源下载失败");
|
||||
throw new Error("资源下载失败");
|
||||
}
|
||||
return { url, response };
|
||||
}));
|
||||
if (resources.some(({ response }) => response.headers.get("X-OFDGo-Checksum") !== BUNDLE_CHECKSUM)) {
|
||||
throw new Error("应用资源版本不一致");
|
||||
throw new Error("资源校验失败");
|
||||
}
|
||||
const bundle = { name: CACHE_PREFIX + crypto.randomUUID(), assets: ASSETS };
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user