Browse Source

feat: PortalPage layout beta

Damon 4 years ago
parent
commit
19ca9fe8ea
2 changed files with 20 additions and 1 deletions
  1. 6 0
      src/components/CoderCard.vue
  2. 14 1
      src/components/EvalCard.vue

+ 6 - 0
src/components/CoderCard.vue

@@ -58,6 +58,12 @@ export default {
         return "RUNNING";
         return "RUNNING";
       }
       }
     },
     },
+    evalURL() {
+      return this.$store.state.token ? "https://eval.seec.seecoder.cn?id_token=" + this.$store.state.token : "https://eval.seec.seecoder.cn";
+    },
+    coderURL() {
+      return this.$store.state.token ? "https://coder.seec.seecoder.cn?id_token=" + this.$store.state.token : "https://coder.seec.seecoder.cn";
+    },
   },
   },
   mounted() {
   mounted() {
   },
   },

+ 14 - 1
src/components/EvalCard.vue

@@ -66,7 +66,13 @@ export default {
       } else {
       } else {
         return "RUNNING";
         return "RUNNING";
       }
       }
-    }
+    },
+    evalURL() {
+      return this.$store.state.token ? "https://eval.seec.seecoder.cn?id_token=" + this.$store.state.token : "https://eval.seec.seecoder.cn";
+    },
+    coderURL() {
+      return this.$store.state.token ? "https://coder.seec.seecoder.cn?id_token=" + this.$store.state.token : "https://coder.seec.seecoder.cn";
+    },
   },
   },
   async mounted() {
   async mounted() {
     const res = await this.$apis.getUserAPI(this.examVO.creatorId);
     const res = await this.$apis.getUserAPI(this.examVO.creatorId);
@@ -80,6 +86,13 @@ export default {
       const D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate());
       const D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate());
       return Y + M + D;
       return Y + M + D;
     },
     },
+    toTestInfo() {
+      if (this.type === "eval") {
+        window.open(this.evalURL);
+      } else {
+        window.open(this.coderURL);
+      }
+    },
   }
   }
 };
 };
 </script>
 </script>