diff --git a/src/modules/pageproxy/pageproxy.controller.ts b/src/modules/pageproxy/pageproxy.controller.ts index 6e6a2090..a693da94 100644 --- a/src/modules/pageproxy/pageproxy.controller.ts +++ b/src/modules/pageproxy/pageproxy.controller.ts @@ -36,9 +36,10 @@ export class PageProxyController { } const indexEntryUrl = `https://raw.githubusercontent.com/mx-space/admin-next/gh-pages/index.html` const indexEntryCdnUrl = `https://cdn.jsdelivr.net/gh/mx-space/admin-next@gh-pages/index.html?t=${+new Date()}` - let entry = await Promise.race([ + let entry = await Promise.any([ // 龟兔赛跑, 乌龟先跑 - (await fetch(indexEntryUrl)).text(), + // eslint-disable-next-line @typescript-eslint/no-empty-function + fetch(indexEntryUrl).then((res) => res.text()), sleep(1000).then(async () => (await fetch(indexEntryCdnUrl)).text()), ]) entry = entry.replace( diff --git a/tsconfig.json b/tsconfig.json index a9ffb2fd..2defd28d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,13 +7,17 @@ "experimentalDecorators": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, - "target": "es2017", + "target": "ES2019", "sourceMap": true, "outDir": "./dist", "baseUrl": ".", "noImplicitAny": false, "incremental": true, "resolveJsonModule": true, + "lib": [ + "ES2021", + "ES2020", + ], "skipLibCheck": true, "paths": { "~": [