update 夜间模式

This commit is contained in:
2021-07-01 19:08:15 +08:00
parent 95cb5b4483
commit 4436230c71
95 changed files with 3286 additions and 721 deletions

View File

@@ -3,7 +3,8 @@ import { SIDER_BREAK_POINT } from "util/global"
const defaultState = {
siderCollapsed: false,
allowSiderCollapsed: true
allowSiderCollapsed: true,
theme: 'default'
}
const localStorageState = () => {
@@ -36,6 +37,7 @@ const layout = (state = mergeState, action) => {
window.localStorage.setItem(SETTING_KEY, JSON.stringify(_state))
return _state
}
// 自动收起侧边
case 'AUTO_TOGGLE_COLLAPSED':
{
const _state = {
@@ -45,6 +47,13 @@ const layout = (state = mergeState, action) => {
}
return _state
}
// 切换主题
case 'SET_THEME':
{
const _state = { ...state, theme: action.theme }
window.localStorage.setItem(SETTING_KEY, JSON.stringify(_state))
return _state
}
default:
return state
}