|
@@ -150,7 +150,7 @@ class RationRepositoryController extends baseController {
|
|
|
const allowHeader = ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];
|
|
|
try {
|
|
|
const uploadOption = {
|
|
|
- uploadDir: './public/tmp'
|
|
|
+ uploadDir: './public'
|
|
|
};
|
|
|
const form = new multiparty.Form(uploadOption);
|
|
|
form.parse(request, async function(err, fields, files) {
|
|
@@ -215,7 +215,7 @@ class RationRepositoryController extends baseController {
|
|
|
}
|
|
|
const excelData = await rationItem.exportExcelData(rationRepId);
|
|
|
const buffer = excel.build([{name: "sheet", data: excelData}]);
|
|
|
- const filePath = './public/tmp/export.xlsx';
|
|
|
+ const filePath = './public/export.xlsx';
|
|
|
fs.writeFileSync(filePath, buffer, 'binary');
|
|
|
const stats = fs.statSync(filePath);
|
|
|
// 下载相关header
|