Przeglądaj źródła

导入类型提示

vian 6 lat temu
rodzic
commit
1faf9f1595

+ 1 - 0
.gitignore

@@ -2,6 +2,7 @@ node_modules/
 .git/
 dist/
 .idea/
+.vscode/
 tmp/
 modules/reports/util/pdf_base_files/*.ttf
 modules/reports/util/pdf_base_files/*.ttc

+ 2 - 1
modules/ration_repository/controllers/ration_repository_controller.js

@@ -196,9 +196,10 @@ class RationRepositoryController extends baseController {
                 if (err || file === null) {
                     throw '上传失败';
                 }
+                console.log(file.headers['content-type']);
                 // 判断类型
                 if (file.headers['content-type'] === undefined || allowHeader.indexOf(file.headers['content-type']) < 0) {
-                    throw '不支持该类型';
+                    throw `不支持该类型:${file.headers['content-type']}`;
                 }
                 // 重命名文件名
                 uploadFullName = uploadOption.uploadDir + '/' + file.originalFilename;