mjh пре 4 година
родитељ
комит
089725a8bd
2 измењених фајлова са 19 додато и 7 уклоњено
  1. 12 4
      src/components/CoderCard.vue
  2. 7 3
      src/components/EvalCard.vue

+ 12 - 4
src/components/CoderCard.vue

@@ -1,7 +1,8 @@
 <template>
   <el-card class="coder" shadow="hover" @click="toTestInfo">
 
-    <div style="border-bottom: 30px solid #8dc9e2; float: right; width: 0; height: 0; position: absolute;right: 0;bottom: 0;border-left: 30px solid transparent;">
+    <div
+      style="border-bottom: 30px solid #8dc9e2; float: right; width: 0; height: 0; position: absolute;right: 0;bottom: 0;border-left: 30px solid transparent;">
       <div style="padding: 0 3px 0 3px; position: absolute; right: 0; bottom: -30px; color: white">
         C
       </div>
@@ -37,6 +38,8 @@
 </template>
 
 <script>
+import {List} from "@element-plus/icons-vue";
+
 export default {
   name: "CoderCard",
   props: {
@@ -59,7 +62,7 @@ export default {
       }
     },
     coderURL() {
-      return this.$store.state.token ? "https://coder.seec.seecoder.cn?id_token=" + this.$store.state.user.token : "https://coder.seec.seecoder.cn";
+      return this.$store.state.user.token ? "https://coder.seec.seecoder.cn?id_token=" + this.$store.state.user.token : "https://coder.seec.seecoder.cn";
     },
   },
   mounted() {
@@ -72,8 +75,13 @@ export default {
       const D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate());
       return Y + M + D;
     },
-    toTestInfo() {
-      window.open(this.coderURL);
+    async toTestInfo() {
+      const res = await this.$apis.getStudentCoderExams({});
+      const userCoderExamsId = res.data.data.res.map(exam => {
+        return exam.id;
+      });
+      console.log(this.coderVO.id in userCoderExamsId);
+      // window.open(this.coderURL);
     },
   },
 };

+ 7 - 3
src/components/EvalCard.vue

@@ -83,9 +83,13 @@ export default {
       const D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate());
       return Y + M + D;
     },
-    toTestInfo() {
-      console.log(this.evalURL);
-      window.open(this.evalURL);
+    async toTestInfo() {
+      const res = await this.$apis.getStudentEvalExams({state: 0});
+      const userEvalExamsId = res.data.data.examVOList.map(exam => {
+        return exam.examId;
+      });
+      console.log(this.examVO.id in userEvalExamsId);
+      // window.open(this.evalURL);
     },
   }
 };