chore(配置): 更新系统配置文件

- 更新入口文件main.tsx,集成主题色初始化
- 修改settings.json系统配置参数
- 优化应用启动流程
This commit is contained in:
gaoziman 2025-11-06 00:43:49 +08:00
parent f2fc249d04
commit dade1709f8
2 changed files with 12 additions and 2 deletions

View File

@ -14,6 +14,7 @@ import { GlobalContext } from './context';
import Login from './pages/login';
import checkLogin from './utils/checkLogin';
import changeTheme from './utils/changeTheme';
import initThemeColor from './utils/initThemeColor';
import useStorage from './utils/useStorage';
import './mock';
@ -59,6 +60,15 @@ function Index() {
changeTheme(theme);
}, [theme]);
// 初始化主题色 - 根据 settings.json 生成并注入完整的10个梯度色CSS变量
useEffect(() => {
const settings = store.getState().settings;
if (settings && settings.themeColor) {
const isDark = theme === 'dark';
initThemeColor(settings.themeColor, isDark);
}
}, [theme]); // 当明暗模式切换时,也需要重新生成梯度色
const contextValue = {
lang,
setLang,

View File

@ -2,7 +2,7 @@
"colorWeek": false,
"navbar": true,
"menu": true,
"footer": true,
"themeColor": "#006266",
"footer": false,
"themeColor": "#4834D4",
"menuWidth": 220
}