fix(admin,server): 上传改用 file.buffer 并移除手写 multipart 头
This commit is contained in:
@@ -255,7 +255,7 @@ export class StudentsController {
|
||||
@UseInterceptors(FileInterceptor('file'))
|
||||
async importExcel(@UploadedFile() file: Express.Multer.File, @Request() req: any) {
|
||||
const workbook = new ExcelJS.Workbook();
|
||||
await workbook.xlsx.load(file.buffer.buffer as ArrayBuffer);
|
||||
await workbook.xlsx.load(file.buffer as unknown as ArrayBuffer);
|
||||
const importData = parseStudentImportWorkbook(workbook);
|
||||
// Resolve organization names to IDs
|
||||
for (const row of importData.students) {
|
||||
@@ -280,7 +280,7 @@ export class StudentsController {
|
||||
@UseInterceptors(FileInterceptor('file'))
|
||||
async matchImport(@UploadedFile() file: Express.Multer.File, @Request() req: any) {
|
||||
const workbook = new ExcelJS.Workbook();
|
||||
await workbook.xlsx.load(file.buffer.buffer as ArrayBuffer);
|
||||
await workbook.xlsx.load(file.buffer as unknown as ArrayBuffer);
|
||||
const importData = parseStudentImportWorkbook(workbook);
|
||||
// Resolve organization names to IDs
|
||||
for (const row of importData.students) {
|
||||
|
||||
Reference in New Issue
Block a user