Browse Source

更新二维码处理逻辑

Michael Wang 3 years ago
parent
commit
df7b340d68

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

@@ -129,9 +129,8 @@ onMounted(async () => {
   if (import.meta.env.DEV) {
   if (import.meta.env.DEV) {
     origin = import.meta.env.VITE_CONFIG_API_SERVER as string;
     origin = import.meta.env.VITE_CONFIG_API_SERVER as string;
   }
   }
-  const toReplaceOrigin = new URL(response.data).origin;
 
 
-  wechat.qrValue = response.data.replace(toReplaceOrigin, origin);
+  wechat.qrValue = response.data + encodeURIComponent("&apiServer=" + origin);
   const trueExamRecordDataId = decodeURIComponent(wechat.qrValue).match(
   const trueExamRecordDataId = decodeURIComponent(wechat.qrValue).match(
     /&examRecordDataId=(\d+)/
     /&examRecordDataId=(\d+)/
   )![1];
   )![1];

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

@@ -204,8 +204,7 @@ async function fetchQRCode() {
       if (import.meta.env.DEV) {
       if (import.meta.env.DEV) {
         origin = import.meta.env.VITE_CONFIG_API_SERVER as string;
         origin = import.meta.env.VITE_CONFIG_API_SERVER as string;
       }
       }
-      const toReplaceOrigin = new URL(response.data).origin;
-      qrValue = response.data.replace(toReplaceOrigin, origin);
+      qrValue = response.data + encodeURIComponent("&apiServer=" + origin);
     } catch (error) {
     } catch (error) {
       logger({
       logger({
         cnl: ["server"],
         cnl: ["server"],