mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-03 16:46:38 +08:00
* feat: add theme berry * docs: add development notes * fix: fix blank page * chore: update implementation * fix: fix package.json * chore: update ui copy --------- Co-authored-by: JustSong <songquanpeng@foxmail.com>
25 lines
445 B
JavaScript
25 lines
445 B
JavaScript
import * as actionTypes from './actions';
|
|
|
|
export const initialState = {
|
|
user: undefined
|
|
};
|
|
|
|
const accountReducer = (state = initialState, action) => {
|
|
switch (action.type) {
|
|
case actionTypes.LOGIN:
|
|
return {
|
|
...state,
|
|
user: action.payload
|
|
};
|
|
case actionTypes.LOGOUT:
|
|
return {
|
|
...state,
|
|
user: undefined
|
|
};
|
|
default:
|
|
return state;
|
|
}
|
|
};
|
|
|
|
export default accountReducer;
|