mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-21 05:19:42 +08:00
22 lines
366 B
JavaScript
22 lines
366 B
JavaScript
import {
|
|
CHANGE_MENU_ITEM
|
|
} from '../../constants/action-types.js'
|
|
|
|
const initialState = {
|
|
curKey: '/'+window.location.hash.split("/")[1]
|
|
}
|
|
|
|
export default (state = initialState, action) => {
|
|
switch (action.type) {
|
|
case CHANGE_MENU_ITEM: {
|
|
return {
|
|
...state,
|
|
curKey: action.data
|
|
};
|
|
}
|
|
default:
|
|
return state;
|
|
}
|
|
}
|
|
|