宇恒一号官网
This commit is contained in:
18
admin/src/utils/disable-debug.js
Normal file
18
admin/src/utils/disable-debug.js
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* 禁止调试模式及右键 - 全局安全模块
|
||||
* 在页面加载时立即执行
|
||||
*/
|
||||
|
||||
// 禁止右键
|
||||
document.addEventListener('contextmenu', (e) => e.preventDefault())
|
||||
|
||||
// 禁止 F12、Ctrl+Shift+I/J/C 等开发者工具快捷键
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (
|
||||
e.key === 'F12' ||
|
||||
(e.ctrlKey && e.shiftKey && ['I', 'J', 'C'].includes(e.key.toUpperCase())) ||
|
||||
(e.ctrlKey && e.key === 'U')
|
||||
) {
|
||||
e.preventDefault()
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user