Browse Source

新domain

Michael Wang 5 years ago
parent
commit
04b3c9aee0
5 changed files with 20 additions and 25 deletions
  1. 3 7
      .env.devAli
  2. 3 2
      .env.production-temp
  3. 6 8
      src/constants/constants.js
  4. 1 2
      src/features/Login/HiddenRequest.js
  5. 7 6
      src/router.js

+ 3 - 7
.env.devAli

@@ -1,10 +1,6 @@
 VUE_APP_SKIP_CHECK_NATIVE=true
 VUE_APP_CONFIG_FILE_SEVER_URL=https://ecs-test-static.qmth.com.cn
-VUE_APP_TK_SERVER_HTML_URL=http://ecs-dev.qmth.com.cn
-VUE_APP_TK_SERVER_API_URL=http://ecs-dev.qmth.com.cn
-VUE_APP_ROUTER_PATH=/oe/
-VUE_APP_PUBLIC_PATH=/
+VUE_APP_ROUTER_PATH=/oe-web/
+VUE_APP_PUBLIC_PATH=/oe-web/
 VUE_APP_SLS_STORE_NAME=student-client-test
-#VUE_APP_WK_SERVER_SOCKET=wss://ecs-dev.qmth.com.cn:8878/api/ws/faceBiopsy
-#VUE_APP_WK_SERVER_SOCKET_FOR_AUDIO=wss://ecs-dev.qmth.com.cn:8878/api/ws/fileAnswer
-VUE_APP_GIT_REPO_VERSION=TO_BE_OVERRIDED
+VUE_APP_GIT_REPO_VERSION=TO_BE_OVERRIDED

+ 3 - 2
.env.production-temp

@@ -1,7 +1,8 @@
+VUE_APP_SKIP_CHECK_NATIVE=true
 VUE_APP_CONFIG_FILE_SEVER_URL=https://ecs-test-static.qmth.com.cn
 # 考虑直接用location.host,即以下两个变量不需要
-VUE_APP_TK_SERVER_HTML_URL=http://ecs.qmth.com.cn
-VUE_APP_TK_SERVER_API_URL=http://ecs.qmth.com.cn
+#VUE_APP_TK_SERVER_HTML_URL=https://ecs.qmth.com.cn
+#VUE_APP_TK_SERVER_API_URL=https://ecs.qmth.com.cn
 VUE_APP_ROUTER_PATH=/oe-web/
 VUE_APP_PUBLIC_PATH=/oe-web/
 VUE_APP_SLS_STORE_NAME=student-client-test

+ 6 - 8
src/constants/constants.js

@@ -1,15 +1,13 @@
 export const FACEID_LINENESS_URL =
   "https://api.megvii.com/faceid/liveness/v2/do?token=";
-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 TK_SERVER_HTML_URL = window.location.origin; //process.env.VUE_APP_TK_SERVER_HTML_URL;
+export const TK_SERVER_API_URL = window.location.origin; //process.env.VUE_APP_TK_SERVER_API_URL;
 export const VUE_APP_WK_SERVER_SOCKET =
-  (window.location.protocol === "https:" ? "wss://" : "ws://") +
-  window.location.host +
-  "/api/ws/faceBiopsy";
+  // (window.location.protocol === "https:" ? "wss://" : "ws://") +
+  "wss://" + window.location.host + "/api/ws/faceBiopsy";
 export const VUE_APP_WK_SERVER_SOCKET_FOR_AUDIO =
-  (window.location.protocol === "https:" ? "wss://" : "ws://") +
-  window.location.host +
-  "/api/ws/fileAnswer";
+  // (window.location.protocol === "https:" ? "wss://" : "ws://") +
+  "wss://" + window.location.host + "/api/ws/fileAnswer";
 export const VUE_APP_CONFIG_FILE_SEVER_URL =
   process.env.VUE_APP_CONFIG_FILE_SEVER_URL;
 export const VUE_APP_SLS_STORE_NAME = process.env.VUE_APP_SLS_STORE_NAME;

+ 1 - 2
src/features/Login/HiddenRequest.js

@@ -1,8 +1,7 @@
 import { TK_SERVER_HTML_URL } from "@/constants/constants.js";
 
 export default function(uuid) {
-  const url =
-    TK_SERVER_HTML_URL.replace("http", "https") + ":8878/resource.js?u=" + uuid;
+  const url = TK_SERVER_HTML_URL + "/resource.js?u=" + uuid;
   // TK_SERVER_HTML_URL.replace("http", "http") + ":8000/resource.js?u=" + uuid;
 
   // if(process.env.NODE_ENV !== 'production')

+ 7 - 6
src/router.js

@@ -25,13 +25,10 @@ let router = new Router({
     {
       path: "/",
       name: "Home",
-      component: OnlineExamHome,
-      props: {
-        examType: "ONLINE", // 在线考试
-      },
+      redirect: "/login",
     },
     {
-      path: "/login/:domain",
+      path: "/login/:domain?",
       name: "Login",
       component: Login,
     },
@@ -126,7 +123,11 @@ router.beforeEach((to, from, next) => {
     window._hmt.push(["_trackPageview", "/oe" + to.fullPath]);
   }
 
-  if (to.path.match(/^\/login\/.+$/) || to.path.match(/^\/StudentAccess$/)) {
+  if (
+    to.path.match(/^\/?/) ||
+    to.path.match(/^\/login\/.?$/) ||
+    to.path.match(/^\/StudentAccess$/)
+  ) {
     next();
   } else {
     if (!localStorage.getItem("domain")) {