fix: 告警说明文档读取问题
This commit is contained in:
@@ -20,10 +20,11 @@ export const xlsxUrl = `${
|
||||
* });
|
||||
*/
|
||||
export async function readLoalXlsx(id: string): Promise<Record<string, any>[]> {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user