Explorar el Código

更改离线考试的题库地址

Michael Wang hace 6 años
padre
commit
347540cb11
Se han modificado 6 ficheros con 14 adiciones y 11 borrados
  1. 2 1
      .env.development
  2. 2 1
      .env.production
  3. 2 1
      .env.staging
  4. 2 1
      src/constants/constants.js
  5. 6 4
      src/features/OfflineExam/OfflineExamList.vue
  6. 0 3
      src/main.js

+ 2 - 1
.env.development

@@ -1,3 +1,4 @@
-VUE_APP_TK_SERVER_URL=http://192.168.10.39:5220
+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/audioAnswer/

+ 2 - 1
.env.production

@@ -1,4 +1,5 @@
-VUE_APP_TK_SERVER_URL=http://ecs.qmth.com.cn
+VUE_APP_TK_SERVER_HTML_URL=http://ecs.qmth.com.cn
+VUE_APP_TK_SERVER_API_URL=http://ecs.qmth.com.cn:8008
 VUE_APP_WK_SERVER_SOCKET=wss://ecs.qmth.com.cn:8878/oewebsocket/
 VUE_APP_WK_SERVER_SOCKET_FOR_AUDIO=wss://ecs.qmth.com.cn:8878/oewebsocket/audioAnswer/
 VUE_APP_GIT_REPO_VERSION=TO_BE_OVERRIDED

+ 2 - 1
.env.staging

@@ -1,3 +1,4 @@
-VUE_APP_TK_SERVER_URL=http://192.168.10.39:5220
+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/audioAnswer/

+ 2 - 1
src/constants/constants.js

@@ -1,6 +1,7 @@
 export const FACEID_LINENESS_URL =
   "https://api.megvii.com/faceid/liveness/v2/do?token=";
-export const TK_SERVER_URL = process.env.VUE_APP_TK_SERVER_URL;
+export const TK_SERVER_HTML_URL = process.env.VUE_APP_TK_SERVER_HTML_URL;
+export const TK_SERVER_API_URL = process.env.VUE_APP_TK_SERVER_API_URL;
 export const VUE_APP_WK_SERVER_SOCKET = process.env.VUE_APP_WK_SERVER_SOCKET;
 export const VUE_APP_WK_SERVER_SOCKET_FOR_AUDIO =
   process.env.VUE_APP_WK_SERVER_SOCKET_FOR_AUDIO;

+ 6 - 4
src/features/OfflineExam/OfflineExamList.vue

@@ -101,14 +101,16 @@
 
 <script>
 import { mapState as globalMapState } from "vuex";
-import { TK_SERVER_URL } from "@/constants/constants.js";
+import {
+  TK_SERVER_HTML_URL,
+  TK_SERVER_API_URL,
+} from "@/constants/constants.js";
 import OfflineExamUpload from "./OfflineExamUpload.vue";
 
 export default {
   name: "EcsOfflineList",
   data() {
     return {
-      tk_server_url: TK_SERVER_URL,
       disableDownloadPaperBtn: false,
     };
   },
@@ -132,7 +134,7 @@ export default {
       };
       window.name = JSON.stringify(user);
       window.location.href =
-        this.tk_server_url +
+        TK_SERVER_HTML_URL +
         "/admin/preview_paper/" +
         course.paperId +
         "?isback=true";
@@ -147,7 +149,7 @@ export default {
       setTimeout(() => (this.disableDownloadPaperBtn = false), 10 * 1000);
 
       window.location.href =
-        this.tk_server_url +
+        TK_SERVER_API_URL +
         "/api/ecs_ques/paper/export/" +
         course.paperId +
         "/PAPER/" +

+ 0 - 3
src/main.js

@@ -24,9 +24,6 @@ Vue.component("main-layout", MainLayout);
 if (process.env.NODE_ENV !== "production") {
   // 测试vue cli打包的环境变量
   console.log("环境检查: process.env.NODE_ENV === " + process.env.NODE_ENV);
-  console.log(
-    "env.VUE_APP_TK_SERVER_URL === " + process.env.VUE_APP_TK_SERVER_URL
-  );
 }
 
 if (process.env.NODE_ENV === "development") {