|
@@ -12,9 +12,13 @@ class ExcelimportService extends Service {
|
|
|
|
|
|
|
|
|
async getImportXLSXData(elem) {
|
|
|
- const filepath = this.ctx.app.config.fileDirImp + elem.content;
|
|
|
+
|
|
|
if (elem.type === '0') {
|
|
|
- const workbook = XLSX.readFile(filepath);
|
|
|
+ const filepath = this.ctx.app.config.baseDirImp + elem.content;
|
|
|
+ const file = await this.ctx.curl(filepath);
|
|
|
+ console.log(11111);
|
|
|
+ console.log(file.data);
|
|
|
+ const workbook = XLSX.read(file.data);
|
|
|
|
|
|
const sheetNames = workbook.SheetNames;
|
|
|
const sheet = workbook.Sheets[sheetNames[0]];
|