Michael Wang 5 年之前
父節點
當前提交
8f45212d79
共有 2 個文件被更改,包括 17 次插入3 次删除
  1. 8 1
      src/features/Login/Login.vue
  2. 9 2
      src/features/OfflineExam/OfflineExamUploadCug.vue

+ 8 - 1
src/features/Login/Login.vue

@@ -808,7 +808,14 @@ export default {
       //   this.disableLoginBtnBecauseNotAllowedNative = false;
       //   this.disableLoginBtnBecauseNotAllowedNative = false;
       //   return;
       //   return;
       // }
       // }
-      if (this.QECSConfig.LOGIN_SUPPORT.includes("NATIVE")) {
+      if (
+        this.QECSConfig.LOGIN_SUPPORT.includes("BROWSER") &&
+        this.QECSConfig.LOGIN_SUPPORT.includes("NATIVE")
+      ) {
+        // FIXME: 暂时允许选择浏览器的可以在浏览器中访问,后期浏览器应该跳转到移动端
+        this.disableLoginBtnBecauseNotAllowedNative = false;
+        return;
+      } else if (this.QECSConfig.LOGIN_SUPPORT.includes("NATIVE")) {
         // 检测是否是学生端。 检测是否有node。检测是否能node调用。
         // 检测是否是学生端。 检测是否有node。检测是否能node调用。
         const hasShell = UA.getBrowser().name === "electron-exam-shell";
         const hasShell = UA.getBrowser().name === "electron-exam-shell";
         const hasNode = typeof nodeRequire !== "undefined";
         const hasNode = typeof nodeRequire !== "undefined";

+ 9 - 2
src/features/OfflineExam/OfflineExamUploadCug.vue

@@ -34,7 +34,7 @@
     </div>
     </div>
     <Modal v-model="showPreview" fullscreen footer-hide :closable="false">
     <Modal v-model="showPreview" fullscreen footer-hide :closable="false">
       <!-- <div slot="header"></div> -->
       <!-- <div slot="header"></div> -->
-      <img id="previewId" />
+      <img id="previewId" class="preview-image" />
     </Modal>
     </Modal>
   </div>
   </div>
 </template>
 </template>
@@ -304,6 +304,7 @@ export default {
             });
             });
           })
           })
           .then(() => {
           .then(() => {
+            // return;
             return printCurrentPage()
             return printCurrentPage()
               .then(filename => {
               .then(filename => {
                 const fs = window.nodeRequire("fs");
                 const fs = window.nodeRequire("fs");
@@ -392,8 +393,14 @@ export default {
 };
 };
 </script>
 </script>
 
 
-<style lang="postcss">
+<style scoped>
 .list .ivu-upload-select {
 .list .ivu-upload-select {
   width: 100%;
   width: 100%;
 }
 }
+.preview-image {
+  max-width: 100vw;
+  max-height: 100vh;
+  margin: -16px;
+  object-fit: contain;
+}
 </style>
 </style>