diff --git a/.env.base b/.env.base
index 1c8fd7c9c..23fc7a4e5 100644
--- a/.env.base
+++ b/.env.base
@@ -18,3 +18,6 @@ VITE_USE_MOCK=true
# 是否使用在线图标
VITE_USE_ONLINE_ICON=true
+
+# 是否隐藏全局设置按钮
+VITE_HIDE_GLOBAL_SETTING=false
diff --git a/.env.dev b/.env.dev
index a4d6b3a94..792c9ea82 100644
--- a/.env.dev
+++ b/.env.dev
@@ -36,3 +36,6 @@ VITE_USE_CSS_SPLIT=true
# 是否使用在线图标
VITE_USE_ONLINE_ICON=true
+
+# 是否隐藏全局设置按钮
+VITE_HIDE_GLOBAL_SETTING=false
diff --git a/.env.gitee b/.env.gitee
index 1a14f0a22..55365740f 100644
--- a/.env.gitee
+++ b/.env.gitee
@@ -36,3 +36,6 @@ VITE_USE_CSS_SPLIT=true
# 是否使用在线图标
VITE_USE_ONLINE_ICON=true
+
+# 是否隐藏全局设置按钮
+VITE_HIDE_GLOBAL_SETTING=false
diff --git a/.env.pro b/.env.pro
index edc668e37..7db3d27b1 100644
--- a/.env.pro
+++ b/.env.pro
@@ -36,3 +36,6 @@ VITE_USE_CSS_SPLIT=true
# 是否使用在线图标
VITE_USE_ONLINE_ICON=false
+
+# 是否隐藏全局设置按钮
+VITE_HIDE_GLOBAL_SETTING=false
diff --git a/.env.test b/.env.test
index b53f34782..e589b030d 100644
--- a/.env.test
+++ b/.env.test
@@ -36,3 +36,6 @@ VITE_USE_CSS_SPLIT=false
# 是否使用在线图标
VITE_USE_ONLINE_ICON=true
+
+# 是否隐藏全局设置按钮
+VITE_HIDE_GLOBAL_SETTING=false
diff --git a/src/layout/Layout.vue b/src/layout/Layout.vue
index 631769554..c807392e9 100644
--- a/src/layout/Layout.vue
+++ b/src/layout/Layout.vue
@@ -20,6 +20,8 @@ const collapse = computed(() => appStore.getCollapse)
const layout = computed(() => appStore.getLayout)
+const hideSetting = computed(() => import.meta.env.VITE_HIDE_GLOBAL_SETTING === 'true')
+
const handleClickOutside = () => {
appStore.setCollapse(true)
}
@@ -59,7 +61,7 @@ export default defineComponent({
-
+ {!unref(hideSetting) && }
)
}
diff --git a/types/global.d.ts b/types/global.d.ts
index ea0fa7720..c8ef5eda5 100644
--- a/types/global.d.ts
+++ b/types/global.d.ts
@@ -82,5 +82,6 @@ declare global {
readonly VITE_USE_CSS_SPLIT: string
readonly VITE_USE_ONLINE_ICON: string
readonly VITE_ICON_PREFIX: string
+ readonly VITE_HIDE_GLOBAL_SETTING: string
}
}