shaogen1995 1 year ago
parent
commit
e3689f2034
2 changed files with 59 additions and 7 deletions
  1. 33 7
      pc/public/knowInfo.html
  2. 26 0
      pc/public/model.html

+ 33 - 7
pc/public/knowInfo.html

@@ -6,6 +6,31 @@
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>Document</title>
 
+  <script>
+
+    // 禁用鼠标右键
+    document.addEventListener("contextmenu", function (e) {
+      e.preventDefault();
+    });
+
+    document.onkeydown = () => {
+      //禁用F12
+      if (window.event && window.event.keyCode == 123) {
+        return false;
+        //禁用ctrl+shift+i,
+      } else if (
+        window.event.ctrlKey &&
+        window.event.shiftKey &&
+        window.event.keyCode == 73
+      ) {
+        return false;
+        //屏蔽Shift+F10
+      } else if (window.event.shiftKey && window.event.keyCode == 121) {
+        return false;
+      }
+    };
+  </script>
+
   <style>
     * {
       margin: 0;
@@ -51,16 +76,16 @@
     /* 移动端样式兼容 */
     @media screen and (max-width: 500px) {
       * {
-      max-width: 100% !important;
-      width: 100% !important;
-      height: auto !important;
-    }
+        max-width: 100% !important;
+        width: 100% !important;
+        height: auto !important;
+      }
 
-      html{
+      html {
         width: calc(100% - 20px) !important;
       }
 
-      body{
+      body {
         width: 100%;
         height: auto;
         overflow-x: hidden;
@@ -74,7 +99,8 @@
         box-shadow: none;
         line-height: 30px;
       }
-      .content{
+
+      .content {
         padding: 0;
       }
 

+ 26 - 0
pc/public/model.html

@@ -7,6 +7,32 @@
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <script src="./4dage.js"></script>
   <title>Document</title>
+
+  <script>
+
+    // 禁用鼠标右键
+    document.addEventListener("contextmenu", function (e) {
+      e.preventDefault();
+    });
+
+    document.onkeydown = () => {
+      //禁用F12
+      if (window.event && window.event.keyCode == 123) {
+        return false;
+        //禁用ctrl+shift+i,
+      } else if (
+        window.event.ctrlKey &&
+        window.event.shiftKey &&
+        window.event.keyCode == 73
+      ) {
+        return false;
+        //屏蔽Shift+F10
+      } else if (window.event.shiftKey && window.event.keyCode == 121) {
+        return false;
+      }
+    };
+  </script>
+
   <style>
     html {
       overflow: hidden;