|
@@ -210,12 +210,14 @@ export default {
|
|
|
this.$refs.ImportFile.setLoading(true);
|
|
|
|
|
|
let formData = new FormData();
|
|
|
- // Object.entries(this.modalForm).forEach(([key, val]) => {
|
|
|
- // if (val !== null) formData.append(key, val);
|
|
|
- // });
|
|
|
- if (this.importType === "docx")
|
|
|
- formData.append("courseId", this.modalForm.courseId);
|
|
|
formData.append("file", this.fileData.file);
|
|
|
+ if (this.importType === "docx") {
|
|
|
+ formData.append("courseId", this.modalForm.courseId);
|
|
|
+ } else {
|
|
|
+ Object.entries(this.modalForm).forEach(([key, val]) => {
|
|
|
+ if (val !== null) formData.append(key, val);
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
const uploadApi =
|
|
|
this.importType === "zip"
|