lsc 2 年之前
父節點
當前提交
89b6ffd536
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      src/components/pages/student/addCourse.vue

+ 6 - 6
src/components/pages/student/addCourse.vue

@@ -4569,9 +4569,7 @@ export default {
                     this.cid = res.data.courseId;
                     this.courseUserid = this.userid;
                     this.islogin = true;
-                    setTimeout(() => {
-                        this.selectCourseDetail();
-                    }, 1000);
+                    this.selectCourseDetail();
                 })
                 .catch((err) => {
                     this.$message.error("网络不佳");
@@ -5943,9 +5941,11 @@ export default {
                         this.templateC.id = "123";
                         this.courseUserid = res.data[0][0].userid;
                         this.nbOrder = res.data[0][0].ordernumber;
-                        this.courseTypeId = []
-                        for (var i = 0; i < res.data[1].length; i++) {
-                            this.courseTypeId.push(res.data[1][i].typeid);
+                        if(res.data[1].length){
+                            this.courseTypeId = []
+                            for (var i = 0; i < res.data[1].length; i++) {
+                                this.courseTypeId.push(res.data[1][i].typeid);
+                            }
                         }
                         console.log(this.courseTypeId);
                         // if (this.timer) clearInterval(this.timer);