Quellcode durchsuchen

fix: 封掉学生测试入口,上线新版本

ChenYangfan vor 6 Jahren
Ursprung
Commit
5a9ba846fb

+ 1 - 1
src/App.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div class="app">
     <slide-up-transition>
       <router-view/>
     </slide-up-transition>

+ 4 - 11
src/config/server-info.js

@@ -4,49 +4,41 @@ const host = process.env.NODE_ENV === 'development' ? 'http://localhost:8080' :
 const wsHost = process.env.NODE_ENV === 'development' ? 'ws://localhost:8080' : 'ws://' + location.host
 
 const slideUrl = host + '/api/slide'
-
 const useSlideServer = postfix => postfix ? slideUrl + postfix : slideUrl
 
 const courseFileUrl = host + '/api/courseFile'
-
 const useCourseFileServer = postfix => postfix ? courseFileUrl + postfix : courseFileUrl
 
 const courseUrl = host + '/api/course'
-
 const useCourseServer = postfix => postfix ? courseUrl + postfix : courseUrl
 
 const codeUrl = host + '/api/code'
-
 const useCodeServer = postfix => postfix ? codeUrl + postfix : codeUrl
 
 const userUrl = host + '/api/user'
-
 const useUserServer = postfix => postfix ? userUrl + postfix : userUrl
 
 const commentUrl = host + '/api/comment'
-
 const useCommentServer = postfix => postfix ? commentUrl + postfix : commentUrl
 
 const messageUrl = host + '/api/message'
-
 const useMessageServer = postfix => postfix ? messageUrl + postfix : messageUrl
 
-const replyUrl = host + '/api/reply'
+const NoticeUrl = host + '/api/notice'
+const useNoticeServer = postfix => postfix ? NoticeUrl + postfix : NoticeUrl
 
+const replyUrl = host + '/api/reply'
 const useReplyServer = postfix => postfix ? replyUrl + postfix : replyUrl
 
 const commentWsUrl = wsHost + '/api/ws/comment'
-
 const useCommentWsServer = postfix => postfix ? commentWsUrl + postfix : commentWsUrl
 
 // const quizUrl = host + '/api/quiz'
 const quizUrl = '/api/quiz'
-
 const useQuizServer = (postfix = '') => quizUrl + postfix
 
 // const questionUrl = host + '/api/question'
 const questionUrl = '/api/question'
-
 const useQuestionServer = (postfix = '') => questionUrl + postfix
 
 export {
@@ -59,6 +51,7 @@ export {
   useReplyServer,
   useCommentWsServer,
   useMessageServer,
+  useNoticeServer,
   useQuizServer,
   useQuestionServer
 }

+ 36 - 0
src/server/notice.js

@@ -0,0 +1,36 @@
+import axios from '@/plugins/axios'
+import { useNoticeServer } from '@/config/server-info'
+
+export function createNotice ({ courseId, title, content }) {
+  const data = {
+    courseId,
+    title,
+    content
+  }
+
+  return axios
+    .post(useNoticeServer(), data)
+    .then(res => res.data)
+}
+
+export function modifyNotice ({ id, courseId, title, content }) {
+  const data = {
+    id,
+    courseId,
+    title,
+    content
+  }
+
+  return axios
+    .put(useNoticeServer(), data)
+}
+
+export function deleteNotice ({ noticeId }) {
+  return axios
+    .delete(useNoticeServer('/' + noticeId))
+}
+
+export function getNotices ({ courseId }) {
+  return axios
+    .get(useNoticeServer('/course/' + courseId))
+}

+ 1 - 1
src/views/student/components/StudentSlideDetail.vue

@@ -16,7 +16,7 @@
         下载课件
       </c-button>
     </a>
-    <c-button block theme="green" class="mb-16" @click="handleToQuiz" icon="edit">查看测验</c-button>
+<!--    <c-button block theme="green" class="mb-16" @click="handleToQuiz" icon="edit">查看测验</c-button>-->
   </tab-side-component>
 </template>
 

+ 12 - 11
src/views/student/tabs/StudentQuiz.vue

@@ -40,8 +40,8 @@
 </template>
 
 <script>
-import { getQuizList } from '@/server/quiz'
-import { QuizState } from '@/server/enums/quiz-state'
+// import { getQuizList } from '@/server/quiz'
+// import { QuizState } from '@/server/enums/quiz-state'
 import CTag from '@/components/Basic/CTag'
 import QuizCard from '@/components/Cards/QuizCard'
 import CButton from '@/components/Basic/CButton'
@@ -66,15 +66,16 @@ export default {
     }
   },
   mounted() {
-    getQuizList({ state: QuizState.ongoing })
-      .then(res => {
-        this.ongoingQuizzes = res.quizzes
-        this.showMore = res.quizzes.length < 5
-      })
-      .catch(err => this.$setErrorMessage(err.response.data.msg))
-    getQuizList({ state: QuizState.closed })
-      .then(res => (this.closedQuizzes = res.quizzes))
-      .catch(err => this.$setErrorMessage(err.response.data.msg))
+    this.$setInfoMessage('测试功能预计本周上线')
+    // getQuizList({ state: QuizState.ongoing })
+    //   .then(res => {
+    //     this.ongoingQuizzes = res.quizzes
+    //     this.showMore = res.quizzes.length < 5
+    //   })
+    //   .catch(err => this.$setErrorMessage(err.response.data.msg))
+    // getQuizList({ state: QuizState.closed })
+    //   .then(res => (this.closedQuizzes = res.quizzes))
+    //   .catch(err => this.$setErrorMessage(err.response.data.msg))
   }
 }
 </script>