Tang hace 2 años
padre
commit
c0afab8972

+ 5 - 4
src/axios.js

@@ -78,6 +78,7 @@ request.interceptors.response.use(async (response) => {
         title: "您已被强制下线"
       })
       store.commit('setCurrentRouter', router.currentRoute)
+      store.commit('setUserInfo', null)
       localStorage.removeItem('user_account')
       localStorage.removeItem('token')
       router.push({
@@ -85,10 +86,10 @@ request.interceptors.response.use(async (response) => {
       })
     } else if (code == 500) {
       if (res.msg !== '无其他端在操作') {
-        Message({
-          message: res.msg,
-          type: "error",
-        });
+        // Message({
+        //   message: res.msg,
+        //   type: "error",
+        // });
       }
       // localStorage.removeItem('user_account')
       // localStorage.removeItem('token')

+ 1 - 0
src/pages/bank-exam/index.vue

@@ -1199,6 +1199,7 @@ export default {
         //交卷
         next();
       } else {
+        next(false)
         //离开
         if (this.bankType == 1) {
           console.log(1);

+ 4 - 4
src/pages/course-detail/components/CourseTree.vue

@@ -922,10 +922,10 @@ export default {
     },
     async getResource(section, type, courseIndex) {
       console.error(section, "section");
-      if (section.doType != 1 && section.learning == 1 && section.type == 2) {
-        this.$message.warning("考试已通过,请勿重复考试");
-        return false;
-      }
+      // if (section.doType != 1 && section.learning == 1 && section.type == 2) {
+      //   this.$message.warning("考试已通过,请勿重复考试");
+      //   return false;
+      // }
       if (
         section.type != 2 &&
         this.isActive(section) &&

+ 4 - 1
src/pages/course-exam/index.vue

@@ -1786,6 +1786,7 @@ export default {
           })
           .then(res => {
             this.recordId = res.data;
+            console.error(self.needPhoto , this.type , this.learning)
             //  节不需要拍照
             if (self.needPhoto && this.type != 2 && !this.learning) {
               this.openPhoto();
@@ -2605,7 +2606,8 @@ export default {
           courseId: this.courseId,
           moduleId: this.moduleId,
           type: this.type,
-          examId: this.examId
+          examId: this.examId,
+          orderGoodsId: this.orderGoodsId,
         })
         .then(res => {
           this.learning = res.data;
@@ -2757,6 +2759,7 @@ export default {
         //交卷
         next();
       } else {
+        next(false)
         //离开
         let ansCount = this.questionOverNum(true); //已答题数
         this.lastCount = this.questionList.length - ansCount; //统计未答完的题数

+ 6 - 4
src/pages/person-center/my-course/index.vue

@@ -977,7 +977,7 @@ export default {
             courseId: courseItem.courseId,
             gradeId: item.gradeId,
             goodsId: item.goodsId,
-            orderGoodsId:item.orderGoodsId
+            orderGoodsId: item.orderGoodsId
           })
           .then(res => {
             // res.data = res.data.filter(
@@ -1152,9 +1152,11 @@ export default {
     },
     async goCourseDetail(item) {
       //-----------------七大员是否允许学习
-      let so = await this.$request.orderstudycheck(item.orderGoodsId);
-      if (so.code !== 200) {
-        return false;
+      try {
+        await this.$request.orderstudycheck(item.orderGoodsId);
+      } catch (error) {
+        this.$message.error(error.msg);
+        return;
       }
       //-----------------学习开通状态
       this.checkFuncA(item);