From 32f16e27a2b4c5a9566e978091b29ab5cfa28985 Mon Sep 17 00:00:00 2001 From: tanlianwang Date: Tue, 10 Mar 2026 15:59:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(bug):=E4=BF=AE=E5=A4=8D=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=BA=9Bbug=EF=BC=8C=E9=A1=BA=E4=BE=BF=E6=8A=BD=E4=BA=86?= =?UTF-8?q?=E6=A0=B9=E7=83=9F=E5=96=9D=E4=BA=86=E6=9D=AF=E8=8C=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/maxkb/const.py | 7 ++----- apps/system_manage/serializers/system.py | 3 ++- ui/src/components/layout-container/index.vue | 2 +- ui/src/layout/components/sidebar/index.vue | 8 +++++++- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/apps/maxkb/const.py b/apps/maxkb/const.py index ffabf19bd..6129a1527 100644 --- a/apps/maxkb/const.py +++ b/apps/maxkb/const.py @@ -15,9 +15,6 @@ VERSION = '2.0.0' # load environment variables from .env file load_dotenv() -# print(os.getenv('MAXKB_CONFIG')) -if os.getenv('MAXKB_CONFIG') is not None: - CONFIG = ConfigManager.load_user_config(root_path=PROJECT_DIR) -else: - CONFIG = ConfigManager.load_user_config(root_path=os.path.abspath('/opt/maxkb/conf')) +# 直接从 /opt/maxkb/conf 目录加载配置 +CONFIG = ConfigManager.load_user_config(root_path=os.path.abspath('/opt/maxkb/conf')) diff --git a/apps/system_manage/serializers/system.py b/apps/system_manage/serializers/system.py index 95b757e9a..f3e1e096d 100644 --- a/apps/system_manage/serializers/system.py +++ b/apps/system_manage/serializers/system.py @@ -16,6 +16,7 @@ from common.constants.cache_version import Cache_Version from common.database_model_manage.database_model_manage import DatabaseModelManage from common.utils.rsa_util import get_key_pair_by_sql from maxkb import settings +from maxkb.const import CONFIG from system_manage.models import SystemSetting @@ -48,5 +49,5 @@ class SystemConfigSerializer(serializers.Serializer): @staticmethod def get_config(): return { - 'mindmap_url': settings.config.get('MINDMAP_URL', '') + 'mindmap_url': CONFIG.get('MINDMAP_URL', '') } diff --git a/ui/src/components/layout-container/index.vue b/ui/src/components/layout-container/index.vue index c2fc96b31..e8f145a2b 100644 --- a/ui/src/components/layout-container/index.vue +++ b/ui/src/components/layout-container/index.vue @@ -50,7 +50,7 @@ const props = defineProps({ }, }) -const isCollapse = ref(false) +const isCollapse = ref(true) const leftWidth = ref(props.minLeftWidth) const isResizing = ref(false) diff --git a/ui/src/layout/components/sidebar/index.vue b/ui/src/layout/components/sidebar/index.vue index c34a3c604..dae0a2afe 100644 --- a/ui/src/layout/components/sidebar/index.vue +++ b/ui/src/layout/components/sidebar/index.vue @@ -76,7 +76,7 @@