dusenyao 3 lat temu
rodzic
commit
9f8d8cb3dc
1 zmienionych plików z 8 dodań i 5 usunięć
  1. 8 5
      src/views/main/TaskList.vue

+ 8 - 5
src/views/main/TaskList.vue

@@ -232,7 +232,9 @@ export default {
     taskLink(type, task_id) {
       let userType = this.$store.state.user.user_type;
       GetMyBookBuyStatus_CurTaskCoursewareBook({ task_id }).then(({ is_buy_all }) => {
-        if (is_buy_all === 'false') return this.$message.warning('您还未购买任务关联课件的所有相关教材,请购买');
+        if (is_buy_all === 'false' && userType === 'STUDENT') {
+          return this.$message.warning('您还未购买任务关联课件的所有相关教材,请购买');
+        }
 
         if (type === 10) {
           CreateEnterLiveRoomSession({
@@ -251,10 +253,11 @@ export default {
 
     taskLink_outside(task_id) {
       GetMyBookBuyStatus_CurTaskCoursewareBook({ task_id }).then(({ is_buy_all }) => {
-        if (is_buy_all === 'false') return this.$message.warning('您还未购买任务关联课件的所有相关教材,请购买');
-        this.$router.push(
-          `/task_detail/${this.$store.state.user.user_type === 'STUDENT' ? 'student' : 'teacher'}/${task_id}`
-        );
+        const userType = this.$store.state.user.user_type;
+        if (is_buy_all === 'false' && userType === 'STUDENT') {
+          return this.$message.warning('您还未购买任务关联课件的所有相关教材,请购买');
+        }
+        this.$router.push(`/task_detail/${userType === 'STUDENT' ? 'student' : 'teacher'}/${task_id}`);
       });
     },