Browse Source

fix(pptEasy): 修正JSON文件生成时使用的数据源变量

修复了在生成PPT课程JSON文件时错误地使用了_pptData2变量的问题,现在正确区分_pptData和_pptData2的使用场景
lsc 5 months ago
parent
commit
7626fada58

+ 8 - 4
src/components/pages/pptEasy/addCourse2.vue

@@ -1614,8 +1614,10 @@ export default {
         })
       }
       // 用_pptData生成json文件,并生成File对象
-      const pptJsonStr = JSON.stringify(_pptData2, null, 2);
+      const pptJsonStr = JSON.stringify(_pptData, null, 2);
+      const pptJsonStr2 = JSON.stringify(_pptData2, null, 2);
       const pptJsonFile = new File([pptJsonStr], this.courseName + ".json", { type: "application/json" });
+      const pptJsonFile2 = new File([pptJsonStr2], this.courseName + ".json", { type: "application/json" });
       // 你可以根据需要将pptJsonFile上传或保存
 
       let _url = await this.uploadFile(pptJsonFile);
@@ -1678,7 +1680,7 @@ export default {
           if(type == 1){
             this.steps = 4;
           }
-          this.uploadFile2(pptJsonFile, this.courseId);
+          this.uploadFile2(pptJsonFile2, this.courseId);
           this.addOp3(
             "1",
             "",
@@ -1712,12 +1714,14 @@ export default {
         })
       }
       // 用_pptData生成json文件,并生成File对象
-      const pptJsonStr = JSON.stringify(_pptData2, null, 2);
+      const pptJsonStr = JSON.stringify(_pptData, null, 2);
+      const pptJsonStr2 = JSON.stringify(_pptData2, null, 2);
       const pptJsonFile = new File([pptJsonStr], this.courseName + ".json", { type: "application/json" });
+      const pptJsonFile2 = new File([pptJsonStr2], this.courseName + ".json", { type: "application/json" });
       // 你可以根据需要将pptJsonFile上传或保存
       console.log(_url)
       let _url = await this.uploadFile(pptJsonFile);
-      this.uploadFile2(pptJsonFile, this.cid);
+      this.uploadFile2(pptJsonFile2, this.cid);
 
       this.pptCourseJson.pptData = _url;
 

+ 8 - 4
src/components/pages/pptEasy/addCourse3.vue

@@ -1795,8 +1795,10 @@ export default {
         })
       }
       // 用_pptData生成json文件,并生成File对象
-      const pptJsonStr = JSON.stringify(_pptData2, null, 2);
+      const pptJsonStr = JSON.stringify(_pptData, null, 2);
+      const pptJsonStr2 = JSON.stringify(_pptData2, null, 2);
       const pptJsonFile = new File([pptJsonStr], this.courseName + ".json", { type: "application/json" });
+      const pptJsonFile2 = new File([pptJsonStr2], this.courseName + ".json", { type: "application/json" });
       // 你可以根据需要将pptJsonFile上传或保存
 
       let _url = await this.uploadFile(pptJsonFile);
@@ -1863,7 +1865,7 @@ export default {
             this.copyCourse(this.cid);
           }
           this.loadgetCourseDetail();
-          this.uploadFile2(pptJsonFile, this.courseId);
+          this.uploadFile2(pptJsonFile2, this.courseId);
           this.addOp3(
             "1",
             "",
@@ -1899,12 +1901,14 @@ export default {
         })
       }
       // 用_pptData生成json文件,并生成File对象
-      const pptJsonStr = JSON.stringify(_pptData2, null, 2);
+      const pptJsonStr = JSON.stringify(_pptData, null, 2);
+      const pptJsonStr2 = JSON.stringify(_pptData2, null, 2);
       const pptJsonFile = new File([pptJsonStr], this.courseName + ".json", { type: "application/json" });
+      const pptJsonFile2 = new File([pptJsonStr2], this.courseName + ".json", { type: "application/json" });
       // 你可以根据需要将pptJsonFile上传或保存
       console.log(_url)
       let _url = await this.uploadFile(pptJsonFile);
-      this.uploadFile2(pptJsonFile, this.cid);
+      this.uploadFile2(pptJsonFile2, this.cid);
 
       this.pptCourseJson.pptData = _url;