From 0bb65da638d10f003ee42814e508e02688c2fcc3 Mon Sep 17 00:00:00 2001 From: hrx <18603305412@163.com> Date: Thu, 20 Nov 2025 16:44:45 +0800 Subject: [PATCH 1/2] updata --- f/web-kboss/src/main.js | 300 +++++++++--------- .../src/views/product/mainPage/index.vue | 5 +- 2 files changed, 152 insertions(+), 153 deletions(-) diff --git a/f/web-kboss/src/main.js b/f/web-kboss/src/main.js index 5eadf49..7cab792 100644 --- a/f/web-kboss/src/main.js +++ b/f/web-kboss/src/main.js @@ -92,184 +92,184 @@ Vue.use(HappyScroll) // ==================== 防 F12 和右键检查功能开始 ==================== // 只在生产环境启用防调试功能 -if (process.env.NODE_ENV === 'production') { - // 禁止右键菜单 - document.addEventListener('contextmenu', function(e) { - e.preventDefault(); - return false; - }); +// if (process.env.NODE_ENV === 'production') { +// // 禁止右键菜单 +// document.addEventListener('contextmenu', function(e) { +// e.preventDefault(); +// return false; +// }); - // 禁止F12和开发者工具快捷键 - document.addEventListener('keydown', function(e) { - // 禁止F12 - if (e.key === 'F12') { - e.preventDefault(); - return false; - } +// // 禁止F12和开发者工具快捷键 +// document.addEventListener('keydown', function(e) { +// // 禁止F12 +// if (e.key === 'F12') { +// e.preventDefault(); +// return false; +// } - // 禁止Ctrl+Shift+I (Chrome, Edge) - if (e.ctrlKey && e.shiftKey && e.key === 'I') { - e.preventDefault(); - return false; - } +// // 禁止Ctrl+Shift+I (Chrome, Edge) +// if (e.ctrlKey && e.shiftKey && e.key === 'I') { +// e.preventDefault(); +// return false; +// } - // 禁止Ctrl+Shift+J (Chrome) - if (e.ctrlKey && e.shiftKey && e.key === 'J') { - e.preventDefault(); - return false; - } +// // 禁止Ctrl+Shift+J (Chrome) +// if (e.ctrlKey && e.shiftKey && e.key === 'J') { +// e.preventDefault(); +// return false; +// } - // 禁止Ctrl+U (查看源代码) - if (e.ctrlKey && e.key === 'u') { - e.preventDefault(); - return false; - } +// // 禁止Ctrl+U (查看源代码) +// if (e.ctrlKey && e.key === 'u') { +// e.preventDefault(); +// return false; +// } - // 禁止Ctrl+Shift+C (开发者工具检查元素) - if (e.ctrlKey && e.shiftKey && e.key === 'C') { - e.preventDefault(); - return false; - } +// // 禁止Ctrl+Shift+C (开发者工具检查元素) +// if (e.ctrlKey && e.shiftKey && e.key === 'C') { +// e.preventDefault(); +// return false; +// } - // 禁止Ctrl+Shift+J (Firefox) - if (e.ctrlKey && e.shiftKey && e.key === 'K') { - e.preventDefault(); - return false; - } - }); +// // 禁止Ctrl+Shift+J (Firefox) +// if (e.ctrlKey && e.shiftKey && e.key === 'K') { +// e.preventDefault(); +// return false; +// } +// }); - // 更准确的开发者工具检测 - let isDevToolsOpened = false; +// // 更准确的开发者工具检测 +// let isDevToolsOpened = false; - // 方法1: 检查开发者工具宽度 - function checkDevToolsByWidth() { - const threshold = 160; // 开发者工具通常至少160px宽 - const widthThreshold = window.outerWidth - window.innerWidth > threshold; - const heightThreshold = window.outerHeight - window.innerHeight > threshold; +// // 方法1: 检查开发者工具宽度 +// function checkDevToolsByWidth() { +// const threshold = 160; // 开发者工具通常至少160px宽 +// const widthThreshold = window.outerWidth - window.innerWidth > threshold; +// const heightThreshold = window.outerHeight - window.innerHeight > threshold; - return widthThreshold || heightThreshold; - } +// return widthThreshold || heightThreshold; +// } - // 方法2: 检查debugger执行时间(更宽松的阈值) - function checkDevToolsByDebugger() { - return new Promise((resolve) => { - const start = performance.now(); - debugger; - const end = performance.now(); - // 使用更宽松的阈值,避免误报 - resolve(end - start > 200); - }); - } +// // 方法2: 检查debugger执行时间(更宽松的阈值) +// function checkDevToolsByDebugger() { +// return new Promise((resolve) => { +// const start = performance.now(); +// debugger; +// const end = performance.now(); +// // 使用更宽松的阈值,避免误报 +// resolve(end - start > 200); +// }); +// } - // 方法3: 检查控制台是否打开 - function checkDevToolsByConsole() { - const element = new Image(); - Object.defineProperty(element, 'id', { - get: function() { - isDevToolsOpened = true; - } - }); +// // 方法3: 检查控制台是否打开 +// function checkDevToolsByConsole() { +// const element = new Image(); +// Object.defineProperty(element, 'id', { +// get: function() { +// isDevToolsOpened = true; +// } +// }); - console.log(element); - console.clear(); // 清除测试日志 - } +// console.log(element); +// console.clear(); // 清除测试日志 +// } - // 方法4: 检查Eruda等移动端调试工具 - function checkMobileDevTools() { - return !!(window.eruda || window.__eruda || window.vConsole); - } +// // 方法4: 检查Eruda等移动端调试工具 +// function checkMobileDevTools() { +// return !!(window.eruda || window.__eruda || window.vConsole); +// } - // 处理检测到调试器的情况 - function handleDebuggerDetected() { - if (!isDevToolsOpened) { - isDevToolsOpened = true; +// // 处理检测到调试器的情况 +// function handleDebuggerDetected() { +// if (!isDevToolsOpened) { +// isDevToolsOpened = true; - // 可以选择以下一种或多种处理方式 - // 1. 显示警告信息(推荐) - alert('检测到开发者工具已打开,为了系统安全,请关闭开发者工具。'); +// // 可以选择以下一种或多种处理方式 +// // 1. 显示警告信息(推荐) +// alert('检测到开发者工具已打开,为了系统安全,请关闭开发者工具。'); - // 2. 跳转到关于页面或其他安全页面 - // window.location.href = '/about'; +// // 2. 跳转到关于页面或其他安全页面 +// // window.location.href = '/about'; - // 3. 清空敏感数据 - // sessionStorage.clear(); - // localStorage.clear(); +// // 3. 清空敏感数据 +// // sessionStorage.clear(); +// // localStorage.clear(); - // 4. 关闭窗口(慎用) - // window.close(); +// // 4. 关闭窗口(慎用) +// // window.close(); - // 5. 禁用页面交互 - // document.body.innerHTML = '
手机号: {{ userInfo.mobile }}
邮箱: {{ userInfo.email }}
- - + ·