fix: 告警说明文档读取问题
This commit is contained in:
@@ -20,10 +20,11 @@ export const xlsxUrl = `${
|
|||||||
* });
|
* });
|
||||||
*/
|
*/
|
||||||
export async function readLoalXlsx(id: string): Promise<Record<string, any>[]> {
|
export async function readLoalXlsx(id: string): Promise<Record<string, any>[]> {
|
||||||
let fileBolb = await (await fetch(`${xlsxUrl}/${id}.xlsx`)).arrayBuffer();
|
let result = await fetch(`${xlsxUrl}/${id}.xlsx`);
|
||||||
if (!fileBolb.byteLength) {
|
if (result.status !== 200) {
|
||||||
fileBolb = await (await fetch(`${xlsxUrl}/all.xlsx`)).arrayBuffer();
|
result = await fetch(`${xlsxUrl}/all.xlsx`);
|
||||||
}
|
}
|
||||||
|
const fileBolb = await result.arrayBuffer();
|
||||||
return readSheet(fileBolb, 0);
|
return readSheet(fileBolb, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user