Răsfoiți Sursa

feat: 传递给小程序的apiServer参数调整

chenhao 2 ani în urmă
părinte
comite
9bfbbd558c

+ 5 - 1
src/features/OnlineExam/CheckComputer.vue

@@ -125,7 +125,11 @@ onMounted(async () => {
       testEnv: true,
     }
   );
-  let origin = window.location.origin;
+  let origin = window.location.origin.replace(
+    /.*(\.(ea100.com.cn|exam-cloud.cn))/,
+    `${location.protocol}://www$1`
+  );
+  console.debug("测试验证:", origin);
   if (import.meta.env.DEV) {
     origin = import.meta.env.VITE_CONFIG_API_SERVER as string;
   }

+ 5 - 1
src/features/OnlineExam/Examing/TextQuestionView.vue

@@ -200,7 +200,11 @@ async function fetchQRCode() {
           noErrorMessage: true,
         }
       );
-      let origin = window.location.origin;
+      let origin = window.location.origin.replace(
+        /.*(\.(ea100.com.cn|exam-cloud.cn))/,
+        `${location.protocol}://www$1`
+      );
+      console.debug("测试验证:", origin);
       if (import.meta.env.DEV) {
         origin = import.meta.env.VITE_CONFIG_API_SERVER as string;
       }