增加禁用开发者工具环境变量

This commit is contained in:
Hooray Hu 2024-06-26 10:42:43 +08:00
parent fb10737c1c
commit fe852477f0
5 changed files with 18 additions and 9 deletions

View File

@ -6,6 +6,8 @@ VITE_APP_TITLE = Fantastic-admin 基础版
VITE_APP_API_BASEURL = /
# 调试工具,可设置 eruda 或 vconsole如果不需要开启则留空
VITE_APP_DEBUG_TOOL =
# 是否禁用开发者工具,可防止被调试
VITE_APP_DISABLE_DEVTOOL = false
# 是否开启代理
VITE_OPEN_PROXY = false

View File

@ -6,6 +6,8 @@ VITE_APP_TITLE = Fantastic-admin 基础版
VITE_APP_API_BASEURL = /
# 调试工具,可设置 eruda 或 vconsole如果不需要开启则留空
VITE_APP_DEBUG_TOOL =
# 是否禁用开发者工具,可防止被调试
VITE_APP_DISABLE_DEVTOOL = true
# 是否在打包时启用 Mock
VITE_BUILD_MOCK = true

View File

@ -32,6 +32,7 @@
"bytemd": "^1.21.0",
"dayjs": "^1.11.11",
"defu": "^6.1.4",
"disable-devtool": "^0.3.7",
"echarts": "^5.5.0",
"element-plus": "^2.7.5",
"eruda": "^3.0.1",

View File

@ -34,7 +34,7 @@ importers:
version: 10.11.0(vue@3.4.29(typescript@5.4.5))
'@vueuse/integrations':
specifier: ^10.11.0
version: 10.11.0(async-validator@4.2.5)(axios@1.7.2)(change-case@5.4.4)(nprogress@0.2.0)(qrcode@1.5.3)(vue@3.4.29(typescript@5.4.5))
version: 10.11.0(async-validator@4.2.5)(axios@1.7.2)(change-case@4.1.2)(nprogress@0.2.0)(qrcode@1.5.3)(vue@3.4.29(typescript@5.4.5))
animate.css:
specifier: ^4.1.1
version: 4.1.1
@ -50,6 +50,9 @@ importers:
defu:
specifier: ^6.1.4
version: 6.1.4
disable-devtool:
specifier: ^0.3.7
version: 0.3.7
echarts:
specifier: ^5.5.0
version: 5.5.0
@ -2894,9 +2897,6 @@ packages:
change-case@4.1.2:
resolution: {integrity: sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==}
change-case@5.4.4:
resolution: {integrity: sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==}
character-entities-html4@2.1.0:
resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==}
@ -3364,6 +3364,9 @@ packages:
resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
engines: {node: '>=8'}
disable-devtool@0.3.7:
resolution: {integrity: sha512-xF5uyEpBhDuy7b4Bb88GQG4IB+2CwuQfkJK9vB/ym+85NQp/f7Wc6hnT40Jy2SkKvEf1xAKpvJUJU3LykTXxKg==}
doctrine@3.0.0:
resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==}
engines: {node: '>=6.0.0'}
@ -9804,7 +9807,7 @@ snapshots:
- '@vue/composition-api'
- vue
'@vueuse/integrations@10.11.0(async-validator@4.2.5)(axios@1.7.2)(change-case@5.4.4)(nprogress@0.2.0)(qrcode@1.5.3)(vue@3.4.29(typescript@5.4.5))':
'@vueuse/integrations@10.11.0(async-validator@4.2.5)(axios@1.7.2)(change-case@4.1.2)(nprogress@0.2.0)(qrcode@1.5.3)(vue@3.4.29(typescript@5.4.5))':
dependencies:
'@vueuse/core': 10.11.0(vue@3.4.29(typescript@5.4.5))
'@vueuse/shared': 10.11.0(vue@3.4.29(typescript@5.4.5))
@ -9812,7 +9815,7 @@ snapshots:
optionalDependencies:
async-validator: 4.2.5
axios: 1.7.2
change-case: 5.4.4
change-case: 4.1.2
nprogress: 0.2.0
qrcode: 1.5.3
transitivePeerDependencies:
@ -10292,9 +10295,6 @@ snapshots:
snake-case: 3.0.4
tslib: 2.6.2
change-case@5.4.4:
optional: true
character-entities-html4@2.1.0: {}
character-entities-legacy@1.1.4: {}
@ -10739,6 +10739,8 @@ snapshots:
dependencies:
path-type: 4.0.0
disable-devtool@0.3.7: {}
doctrine@3.0.0:
dependencies:
esutils: 2.0.3

View File

@ -1,6 +1,7 @@
<script setup lang="ts">
import eruda from 'eruda'
import VConsole from 'vconsole'
import DisableDevtool from 'disable-devtool'
import hotkeys from 'hotkeys-js'
import eventBus from './utils/eventBus'
import Provider from './ui-provider/index.vue'
@ -64,6 +65,7 @@ onMounted(() => {
import.meta.env.VITE_APP_DEBUG_TOOL === 'eruda' && eruda.init()
import.meta.env.VITE_APP_DEBUG_TOOL === 'vconsole' && new VConsole()
import.meta.env.VITE_APP_DISABLE_DEVTOOL === 'true' && DisableDevtool()
</script>
<template>