Sfoglia il codice sorgente

图片作答:添加测试机构

Michael Wang 5 anni fa
parent
commit
c3c6492fb2

+ 5 - 2
src/components/MainLayout/MainLayout.vue

@@ -148,8 +148,11 @@ export default {
       });
     },
     ifShowQr() {
-      const domain = localStorage.getItem("domain") || "";
-      return domain.includes("ecs-dev") || domain.includes("exam.qmth.com.cn");
+      // const domain = localStorage.getItem("domain") || "";
+      // return domain.includes("ecs-dev") || domain.includes("exam.qmth.com.cn");
+
+      const shouldShow = this.QECSConfig.SHOW_STUDENT_CLIENT_APP_QRCODE;
+      return shouldShow === "true";
     },
     isEpcc() {
       return this.user.schoolDomain === "iepcc-ps.qmth.com.cn";

+ 10 - 6
src/features/OnlineExam/Examing/TextQuestionView.vue

@@ -155,6 +155,13 @@ const { mapMutations, mapGetters, mapState } = createNamespacedHelpers(
 import VueQrcode from "@chenfengyuan/vue-qrcode";
 import UploadPhotos from "./UploadPhotos";
 
+const QR_DOMAIN_ARRAYS = ["iepcc-ps.ecs.qmth.com.cn"];
+
+if (process.env.NODE_ENV !== "production") {
+  QR_DOMAIN_ARRAYS.push(
+    ...["ecs-dev.qmth.com.cn", "test.qmth.com.cn", "test.ecs-dev.qmth.com.cn"]
+  );
+}
 export default {
   name: "TextQuestionView",
   data() {
@@ -243,8 +250,7 @@ export default {
     fetchQRCode() {
       const shouldFetch =
         this.examQuestion.answerType === "SINGLE_AUDIO" ||
-        this.$store.state.user.schoolDomain === "ecs-dev.qmth.com.cn";
-      this.$store.state.user.schoolDomain === "iepcc-ps.ecs.qmth.com.cn";
+        QR_DOMAIN_ARRAYS.includes(this.$store.state.user.schoolDomain);
       if (shouldFetch) {
         const transferFileType =
           this.examQuestion.answerType === "SINGLE_AUDIO" ? "AUDIO" : "PIC";
@@ -337,16 +343,14 @@ export default {
     shouldFetchQrCode() {
       const shouldFetch =
         this.examQuestion.answerType === "SINGLE_AUDIO" ||
-        this.$store.state.user.schoolDomain === "ecs-dev.qmth.com.cn" ||
-        this.$store.state.user.schoolDomain === "iepcc-ps.ecs.qmth.com.cn";
+        QR_DOMAIN_ARRAYS.includes(this.$store.state.user.schoolDomain);
 
       return shouldFetch;
     },
     canAttachPhotos() {
       return (
         (this.$store.state.user.schoolDomain === "csu.ecs.qmth.com.cn" ||
-          this.$store.state.user.schoolDomain === "ecs-dev.qmth.com.cn" ||
-          this.$store.state.user.schoolDomain === "iepcc-ps.ecs.qmth.com.cn") &&
+          QR_DOMAIN_ARRAYS.includes(this.$store.state.user.schoolDomain)) &&
         !this.isAudioAnswerType
       );
     },