Эх сурвалжийг харах

检测照片上传工具的版本

Michael Wang 6 жил өмнө
parent
commit
3df74601fc
1 өөрчлөгдсөн 58 нэмэгдсэн , 44 устгасан
  1. 58 44
      public/index.html

+ 58 - 44
public/index.html

@@ -1,47 +1,61 @@
 <!DOCTYPE html>
 <html>
+  <head>
+    <meta charset="utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
+    <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
+    <title>photo-upload</title>
+    <script type="text/javascript">
+      const app_version = 3.0;
+      if (typeof require === "undefined") {
+        document.writeln(
+          `不能通过浏览器访问本页面。请下载最新 <a href='https://ecs.qmth.com.cn:8878/electron-config/照片上传工具-3.0-正式版.exe'>照片上传工具</a>`
+        );
+      }
+      if (navigator.appVersion.match(/ECS-PHOTO-UPLOAD\/(\S+)/)[1] != "3.0") {
+        document.writeln(
+          `照片上传工具版本过时。请下载最新 <a href='https://ecs.qmth.com.cn:8878/electron-config/照片上传工具-3.0-正式版.exe'>照片上传工具</a>`
+        );
+      }
+    </script>
+    <script>
+      (function() {
+        // 按Ctrl+Shift+U,放开U,在一秒内再按Ctrl+Shift+P,可以调出开发者工具
+        let firstStepKey = false;
+        document.addEventListener("keydown", function(e) {
+          if (e.ctrlKey && e.shiftKey && e.code === "KeyU") {
+            firstStepKey = true;
+            setTimeout(() => {
+              firstStepKey = false;
+            }, 1000);
+          }
+          if (firstStepKey && e.ctrlKey && e.shiftKey && e.code === "KeyP") {
+            nodeRequire("electron")
+              .remote.getCurrentWindow()
+              .toggleDevTools();
+          }
+        });
+      })();
+    </script>
+    <script type="text/javascript">
+      if (typeof require != "undefined") {
+        window.nodeRequire = require;
+        delete window.require;
+        delete window.exports;
+        delete window.module;
+      }
+    </script>
+  </head>
 
-<head>
-  <meta charset="utf-8">
-  <meta http-equiv="X-UA-Compatible" content="IE=edge">
-  <meta name="viewport" content="width=device-width,initial-scale=1.0">
-  <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-  <title>photo-upload</title>
-  <script>
-    (function () {
-      // 按Ctrl+Shift+U,放开U,在一秒内再按Ctrl+Shift+P,可以调出开发者工具
-      let firstStepKey = false
-      document.addEventListener("keydown", function (e) {
-        if (e.ctrlKey && e.shiftKey && e.code === 'KeyU') {
-          firstStepKey = true;
-          setTimeout(() => {
-            firstStepKey = false
-          }, 1000);
-        }
-        if (firstStepKey && e.ctrlKey && e.shiftKey && e.code === 'KeyP') {
-          nodeRequire('electron').remote.getCurrentWindow().toggleDevTools();
-        }
-      });
-    })()
-  </script>
-  <script type="text/javascript">
-    if (typeof (require) != "undefined") {
-      window.nodeRequire = require;
-      delete window.require;
-      delete window.exports;
-      delete window.module;
-    }
-  </script>
-</head>
-
-<body>
-  <noscript>
-    <strong>We're sorry but examcloud-web-photo-upload doesn't work properly without JavaScript enabled. Please enable
-      it
-      to continue.</strong>
-  </noscript>
-  <div id="app"></div>
-  <!-- built files will be auto injected -->
-</body>
-
-</html>
+  <body>
+    <noscript>
+      <strong
+        >We're sorry but examcloud-web-photo-upload doesn't work properly
+        without JavaScript enabled. Please enable it to continue.</strong
+      >
+    </noscript>
+    <div id="app"></div>
+    <!-- built files will be auto injected -->
+  </body>
+</html>