update 夜间模式
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user