Commit aef1e4a2 authored by ddcat1115's avatar ddcat1115

fix #52

parent 748fd44b
......@@ -78,7 +78,15 @@ class BasicLayout extends React.PureComponent {
}
onMenuClick = ({ key }) => {
if (key === 'logout') {
this.props.dispatch({
type: 'login/logout',
payload: {
status: false,
},
callback: () => {
this.props.dispatch(routerRedux.push('/user/login'));
},
});
}
}
getDefaultCollapsedSubMenus(props) {
......
......@@ -38,6 +38,15 @@ export default {
payload: false,
});
},
*logout({ payload, callback }, { put }) {
yield put({
type: 'logoutHandle',
payload,
});
if (callback) {
callback();
}
},
},
reducers: {
......@@ -54,5 +63,11 @@ export default {
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