Przeglądaj źródła

fix: 修改门户硬编码的测试

weijin 4 lat temu
rodzic
commit
e4c8381275
2 zmienionych plików z 4 dodań i 4 usunięć
  1. 3 2
      components/TestCard.vue
  2. 1 2
      pages/index.vue

+ 3 - 2
components/TestCard.vue

@@ -44,7 +44,7 @@ export default {
   },
   mounted () {
     const now = new Date()
-    if (new Date(this.exam.startTime) < now) {
+    if (new Date(this.exam.startTime) < now && new Date(this.exam.endTime) > now) {
       this.isStarted = true
     }
   },
@@ -53,7 +53,8 @@ export default {
       window.location.href = location
     },
     goEval: function () {
-      window.location.href = 'https://eval.seec.seecoder.cn/'
+      const location = 'https://eval.seec.seecoder.cn'
+      window.location.href = location
     }
   }
 }

+ 1 - 2
pages/index.vue

@@ -74,7 +74,6 @@ export default {
     }
   },
   mounted () {
-    const token = this.$store.state.token
     this.$api.get('https://eval.seec.seecoder.cn/api/exam/list?pageSize=5&pageNum=1').then(res => {
       this.examList = res.data.result.examVOList.slice(0, 3)
       this.examList.forEach((item) => {
@@ -87,7 +86,7 @@ export default {
         item.location = 'https://eval.seec.seecoder.cn/exam/' + item.examId + '/before-exam'
       })
     }).catch(() => {
-      this.examList = JSON.parse('[{"examId":8,"examName":"软件工程测试-seecoder成员内测版","position":"seecoder","skills":["Java","JavaScript"],"difficulty":0,"startTime":"2021-11-02 20:00:00","endTime":"2021-11-03 20:00:00","comment":"软件工程第一次测试","inviteCode":"hraewxj","creatorId":1480,"antiCheating":false,"isJoined":false,"isPublic":false},{"examId":9,"examName":"设计模式测试-seecoder成员内测版","position":"设计师","skills":["Vue"],"difficulty":0,"startTime":"2021-11-02 20:00:00","endTime":"2021-11-03 20:00:00","comment":"设计模式练习","inviteCode":"","creatorId":1480,"antiCheating":false,"isJoined":false,"isPublic":true},{"examId":10,"examName":"软件过程测试-seecoder成员内测版","position":"荣老师的学生","skills":["Go","Python"],"difficulty":0,"startTime":"2021-11-02 20:00:00","endTime":"2021-11-03 20:00:00","comment":"软件过程要好好学","inviteCode":"","creatorId":1480,"antiCheating":false,"isJoined":false,"isPublic":true}]')
+      this.examList = JSON.parse('[{"examId":11,"examName":"基于Java的面向对象编程范式-学前测试","position":"学生","skills":["Java"],"difficulty":0,"startTime":"2021-11-05 14:32:00","endTime":"2021-12-31 23:59:00","comment":"","inviteCode":"","creatorId":1480,"antiCheating":false,"isJoined":false,"isPublic":true,"isHidden":false},{"examId":8,"examName":"软件工程测试","position":"seecoder","skills":["Java","JavaScript"],"difficulty":0,"startTime":"2021-11-02 20:00:00","endTime":"2021-11-03 20:00:00","comment":"软件工程第一次测试","inviteCode":"hraewxj","creatorId":1480,"antiCheating":false,"isJoined":false,"isPublic":false,"isHidden":false},{"examId":9,"examName":"设计模式测试","position":"设计师","skills":["Vue"],"difficulty":0,"startTime":"2021-11-02 20:00:00","endTime":"2021-11-03 20:00:00","comment":"设计模式练习","inviteCode":"","creatorId":1480,"antiCheating":false,"isJoined":false,"isPublic":true,"isHidden":false}]')
       this.examList.forEach((item) => {
         const startTime = item.startTime
         const endTime = item.endTime