//在app.vue添加一下代码
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<script>
export default {
name: "App",
data() {
return {};
},
methods:{
},
mounted() {
if (process.env.mode === 'production') {
(function noDebugger() {
function testDebugger() {
var d = new Date();
debugger;
if (new Date() - d > 10) {
document.body.innerHTML = '<div>管理员已禁用调试模式!!!年轻人,不要太好奇</div>';
alert("管理员已禁用调试模式")
return true;
}
return false;
}
function start() {
while (testDebugger()) {
testDebugger();
}
}
if (!testDebugger()) {
window.onblur = function () {
setTimeout(function () {
start();
}, 500);
};
} else {
start();
}
})();
}
},
};
</script>
<style>
#app {
/* font-family: Avenir, Helvetica, Arial, sans-serif; */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
/* width: 100vw; */
height: 100vh;
overflow: hidden;
box-sizing: border-box;
}
</style>
09-11
774
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-08
1240
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-15
1056
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-10
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交