Commit aef1e4a2 authored by ddcat1115's avatar ddcat1115

fix #52

parent 748fd44b
...@@ -78,7 +78,15 @@ class BasicLayout extends React.PureComponent { ...@@ -78,7 +78,15 @@ class BasicLayout extends React.PureComponent {
} }
onMenuClick = ({ key }) => { onMenuClick = ({ key }) => {
if (key === 'logout') { if (key === 'logout') {
this.props.dispatch({
type: 'login/logout',
payload: {
status: false,
},
callback: () => {
this.props.dispatch(routerRedux.push('/user/login')); this.props.dispatch(routerRedux.push('/user/login'));
},
});
} }
} }
getDefaultCollapsedSubMenus(props) { getDefaultCollapsedSubMenus(props) {
......
...@@ -38,6 +38,15 @@ export default { ...@@ -38,6 +38,15 @@ export default {
payload: false, payload: false,
}); });
}, },
*logout({ payload, callback }, { put }) {
yield put({
type: 'logoutHandle',
payload,
});
if (callback) {
callback();
}
},
}, },
reducers: { reducers: {
...@@ -54,5 +63,11 @@ export default { ...@@ -54,5 +63,11 @@ export default {
submitting: payload, submitting: payload,
}; };
}, },
logoutHandle(state, { payload }) {
return {
...state,
status: payload.status,
};
},
}, },
}; };
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment