Browse Source

fix 测试环境

Michael Wang 5 years ago
parent
commit
4bc9632868
2 changed files with 10 additions and 7 deletions
  1. 2 1
      .env.staging
  2. 8 6
      src/features/OnlineExam/Examing/TextQuestionView.vue

+ 2 - 1
.env.staging

@@ -1,4 +1,5 @@
 VUE_APP_TK_SERVER_HTML_URL=http://192.168.10.39:5220
 VUE_APP_TK_SERVER_API_URL=http://192.168.10.39:8008
 VUE_APP_WK_SERVER_SOCKET=wss://ecs-dev.qmth.com.cn:8878/oewebsocket/
-VUE_APP_WK_SERVER_SOCKET_FOR_AUDIO=wss://ecs-dev.qmth.com.cn:8878/oewebsocket/fileAnswer/
+VUE_APP_WK_SERVER_SOCKET_FOR_AUDIO=wss://ecs-dev.qmth.com.cn:8878/oewebsocket/fileAnswer/
+VUE_APP_CAN_UPLOAD_PHOTOS_FOR_TEST=true

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

@@ -155,10 +155,10 @@ 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"];
+const DOMAINS_CAN_UPLOAD_PHOTOS = ["iepcc-ps.ecs.qmth.com.cn"];
 
-if (process.env.NODE_ENV !== "production") {
-  QR_DOMAIN_ARRAYS.push(
+if (process.env.VUE_APP_CAN_UPLOAD_PHOTOS_FOR_TEST === "true") {
+  DOMAINS_CAN_UPLOAD_PHOTOS.push(
     ...["ecs-dev.qmth.com.cn", "test.qmth.com.cn", "test.ecs-dev.qmth.com.cn"]
   );
 }
@@ -250,7 +250,7 @@ export default {
     fetchQRCode() {
       const shouldFetch =
         this.examQuestion.answerType === "SINGLE_AUDIO" ||
-        QR_DOMAIN_ARRAYS.includes(this.$store.state.user.schoolDomain);
+        DOMAINS_CAN_UPLOAD_PHOTOS.includes(this.$store.state.user.schoolDomain);
       if (shouldFetch) {
         const transferFileType =
           this.examQuestion.answerType === "SINGLE_AUDIO" ? "AUDIO" : "PIC";
@@ -343,14 +343,16 @@ export default {
     shouldFetchQrCode() {
       const shouldFetch =
         this.examQuestion.answerType === "SINGLE_AUDIO" ||
-        QR_DOMAIN_ARRAYS.includes(this.$store.state.user.schoolDomain);
+        DOMAINS_CAN_UPLOAD_PHOTOS.includes(this.$store.state.user.schoolDomain);
 
       return shouldFetch;
     },
     canAttachPhotos() {
       return (
         (this.$store.state.user.schoolDomain === "csu.ecs.qmth.com.cn" ||
-          QR_DOMAIN_ARRAYS.includes(this.$store.state.user.schoolDomain)) &&
+          DOMAINS_CAN_UPLOAD_PHOTOS.includes(
+            this.$store.state.user.schoolDomain
+          )) &&
         !this.isAudioAnswerType
       );
     },