update at 2026-02-14 11:01:22
This commit is contained in:
@@ -251,7 +251,11 @@ function parseXlsxBuffer(buffer) {
|
||||
throw new Error('当前环境未启用 xlsx 解析,请先在开发者工具执行“构建 npm”');
|
||||
}
|
||||
|
||||
const workbook = xlsx.read(buffer, { type: 'array' });
|
||||
const workbook = xlsx.read(buffer, {
|
||||
type: 'array',
|
||||
// 兼容部分旧版 xls 在小程序环境下的中文 codepage 解析。
|
||||
codepage: 936
|
||||
});
|
||||
const firstSheetName = workbook.SheetNames[0];
|
||||
if (!firstSheetName) {
|
||||
throw new Error('Excel 文件中没有工作表');
|
||||
|
||||
Reference in New Issue
Block a user