应用配置 app.enableAppSetting 迁移到环境变量文件中

This commit is contained in:
Hooray Hu 2023-12-18 00:14:18 +08:00
parent b8b18a8d83
commit be4cb14a9a
6 changed files with 7 additions and 8 deletions

View File

@ -1,3 +1,5 @@
# 应用配置面板
VITE_APP_SETTING = true
# 页面标题 # 页面标题
VITE_APP_TITLE = Fantastic-admin 基础版 VITE_APP_TITLE = Fantastic-admin 基础版
# 接口请求地址,会设置到 axios 的 baseURL 参数上 # 接口请求地址,会设置到 axios 的 baseURL 参数上

View File

@ -1,3 +1,5 @@
# 应用配置面板
VITE_APP_SETTING = true
# 页面标题 # 页面标题
VITE_APP_TITLE = Fantastic-admin 基础版 VITE_APP_TITLE = Fantastic-admin 基础版
# 接口请求地址,会设置到 axios 的 baseURL 参数上 # 接口请求地址,会设置到 axios 的 baseURL 参数上

View File

@ -68,6 +68,8 @@ onUnmounted(() => {
hotkeys.unbind('f5') hotkeys.unbind('f5')
hotkeys.unbind('alt+`') hotkeys.unbind('alt+`')
}) })
const enableAppSetting = import.meta.env.VITE_APP_SETTING === 'true'
</script> </script>
<template> <template>
@ -98,7 +100,7 @@ onUnmounted(() => {
</div> </div>
<Search /> <Search />
<HotkeysIntro /> <HotkeysIntro />
<template v-if="settingsStore.settings.app.enableAppSetting"> <template v-if="enableAppSetting">
<div class="app-setting" @click="eventBus.emit('global-app-setting-toggle')"> <div class="app-setting" @click="eventBus.emit('global-app-setting-toggle')">
<SvgIcon name="uiw:setting-o" class="icon" /> <SvgIcon name="uiw:setting-o" class="icon" />
</div> </div>

View File

@ -9,7 +9,6 @@ const globalSettingsDefault: RecursiveRequired<Settings.all> = {
enableProgress: true, enableProgress: true,
enableDynamicTitle: false, enableDynamicTitle: false,
routeBaseOn: 'frontend', routeBaseOn: 'frontend',
enableAppSetting: false,
}, },
home: { home: {
enable: true, enable: true,

View File

@ -6,7 +6,6 @@ const globalSettings: Settings.all = {
app: { app: {
enablePermission: true, enablePermission: true,
enableDynamicTitle: true, enableDynamicTitle: true,
enableAppSetting: true,
}, },
layout: { layout: {
enableMobileAdaptation: true, enableMobileAdaptation: true,

View File

@ -38,11 +38,6 @@ declare namespace Settings {
* @可选值 `'filesystem'` * @可选值 `'filesystem'`
*/ */
routeBaseOn?: 'frontend' | 'backend' | 'filesystem' routeBaseOn?: 'frontend' | 'backend' | 'filesystem'
/**
*
* @默认值 `false`
*/
enableAppSetting?: boolean
} }
interface home { interface home {
/** /**