mjh 4 anni fa
parent
commit
4b90ef5be3

+ 4 - 4
src/api/course/course.js

@@ -32,10 +32,10 @@ function getStudentCourses(studentId) {
   });
 }
 
-function getCourse(courseId) {
-  return axios.get(`${prefix}`, {
+function getCourseById(id) {
+  return axios.get(`${prefix}/getCourseById`, {
     params: {
-      courseId
+      id
     },
   });
 }
@@ -75,7 +75,7 @@ const courseAPIs = {
   getAllCourses,
   getTeacherCourses,
   getStudentCourses,
-  getCourse,
+  getCourseById,
   deleteCourse,
   updateCourse,
   getExampleCourses,

+ 1 - 1
src/views/CoursePage/CourseDetail.vue

@@ -265,7 +265,7 @@ export default {
     },
   },
   async mounted() {
-    this.$apis.getCourse(this.$route.params.id)
+    this.$apis.getCourseById(this.$route.params.id)
       .then(res => {
         this.courseInfo = res.data.data;
       });

+ 2 - 3
src/views/PortalPage/PortalPage.vue

@@ -79,7 +79,7 @@
                 @click="$router.push('/manage')">管理页面</span>
           查看相关测试。
         </div>
-        <div v-if="isTeacher">
+        <div v-if="isStudent">
           <div v-if="isLogin" :style="{height: (testRowHeight - 63) + 'px'}" class="portal-card-main">
             <div class="portal-my-card-main">
               <div v-if="myTestList.length !== 0">
@@ -221,8 +221,7 @@ export default {
         .then(res => {
           this.myCourseList = res.data.data;
         })
-        .catch(err => {
-        });
+        .catch();
       this.$apis.getStudentEvalExams({state: 0})
         .then(
           res => {