From c2b00265e35e5e3b511ed5178c9b86cce7c639e5 Mon Sep 17 00:00:00 2001 From: wxj Date: Tue, 28 Jul 2026 09:33:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E8=93=9D=E8=89=B2=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=EF=BC=9A=E7=A7=BB=E9=99=A4=E6=9A=97=E9=BB=91=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E5=88=87=E6=8D=A2=E3=80=81=E9=9A=90=E8=97=8F=E5=A4=9A?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E9=80=89=E6=8B=A9=E5=99=A8=E3=80=81=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E4=BA=AE=E8=89=B2=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/package.json | 1 + web/src/components/layout/headerbar/ActionButtons.jsx | 1 + web/src/components/settings/PersonalSetting.jsx | 2 +- web/src/context/Theme/index.jsx | 6 +++--- web/src/hooks/common/useHeaderBar.js | 3 ++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/web/package.json b/web/package.json index e51d4da..54521aa 100644 --- a/web/package.json +++ b/web/package.json @@ -6,6 +6,7 @@ "dependencies": { "@douyinfe/semi-icons": "^2.63.1", "@douyinfe/semi-illustrations": "^2.100.0", + "@douyinfe/semi-theme-default": "^2.101.0", "@douyinfe/semi-ui": "^2.69.1", "@lobehub/icons": "^2.0.0", "@visactor/react-vchart": "~1.8.8", diff --git a/web/src/components/layout/headerbar/ActionButtons.jsx b/web/src/components/layout/headerbar/ActionButtons.jsx index 8fcf012..8346575 100644 --- a/web/src/components/layout/headerbar/ActionButtons.jsx +++ b/web/src/components/layout/headerbar/ActionButtons.jsx @@ -36,6 +36,7 @@ const ActionButtons = ({ isMobile, isSelfUseMode, showThemeToggle = true, + // 默认隐藏顶栏语言选择器,仅保留简体中文 showLanguageSelector = false, logout, navigate, diff --git a/web/src/components/settings/PersonalSetting.jsx b/web/src/components/settings/PersonalSetting.jsx index d665b31..dcc3b3a 100644 --- a/web/src/components/settings/PersonalSetting.jsx +++ b/web/src/components/settings/PersonalSetting.jsx @@ -597,7 +597,7 @@ const PersonalSetting = () => { onPasskeyDelete={handleRemovePasskey} /> - {/* 偏好设置(语言等)- 已隐藏 */} + {/* 偏好设置(语言等)- 已隐藏:多语言功能屏蔽,统一使用简体中文 */} {/* */} diff --git a/web/src/context/Theme/index.jsx b/web/src/context/Theme/index.jsx index bdd5a65..300bd04 100644 --- a/web/src/context/Theme/index.jsx +++ b/web/src/context/Theme/index.jsx @@ -47,9 +47,9 @@ const getSystemTheme = () => { export const ThemeProvider = ({ children }) => { const [theme, _setTheme] = useState(() => { try { - return localStorage.getItem('theme-mode') || 'auto'; + return localStorage.getItem('theme-mode-v2') || 'light'; } catch { - return 'auto'; + return 'light'; } }); @@ -101,7 +101,7 @@ export const ThemeProvider = ({ children }) => { } _setTheme(themeValue); - localStorage.setItem('theme-mode', themeValue); + localStorage.setItem('theme-mode-v2', themeValue); }, []); return ( diff --git a/web/src/hooks/common/useHeaderBar.js b/web/src/hooks/common/useHeaderBar.js index eb28cee..2a77f71 100644 --- a/web/src/hooks/common/useHeaderBar.js +++ b/web/src/hooks/common/useHeaderBar.js @@ -107,8 +107,9 @@ export const useHeaderBar = ({ onMobileMenuToggle, drawerOpen }) => { const isConsoleRoute = location.pathname.startsWith('/console'); - // 读取顶栏主题切换和语言选择器开关配置 + // 读取顶栏主题切换开关,语言选择器已强制关闭(仅保留简体中文) const showThemeToggle = statusState?.status?.HeaderShowThemeToggle !== false; + // 多语言切换已屏蔽,后端 HeaderShowLanguageSelector 开关不再生效 const showLanguageSelector = false; const theme = useTheme();