diff --git a/src/utils/execl-utils.ts b/src/utils/execl-utils.ts index 9a7c95b2..45774aec 100644 --- a/src/utils/execl-utils.ts +++ b/src/utils/execl-utils.ts @@ -20,10 +20,11 @@ export const xlsxUrl = `${ * }); */ export async function readLoalXlsx(id: string): Promise[]> { - let fileBolb = await (await fetch(`${xlsxUrl}/${id}.xlsx`)).arrayBuffer(); - if (!fileBolb.byteLength) { - fileBolb = await (await fetch(`${xlsxUrl}/all.xlsx`)).arrayBuffer(); + let result = await fetch(`${xlsxUrl}/${id}.xlsx`); + if (result.status !== 200) { + result = await fetch(`${xlsxUrl}/all.xlsx`); } + const fileBolb = await result.arrayBuffer(); return readSheet(fileBolb, 0); }