Commit cf2dd50b authored by nano's avatar nano

logout

parent c01f782d
...@@ -208,10 +208,14 @@ export default { ...@@ -208,10 +208,14 @@ export default {
dispatch(routerRedux.replace('/signin')); dispatch(routerRedux.replace('/signin'));
} }
history.listen(({ pathname }) => { history.listen(({ pathname, query }) => {
if (pathname === '/') { if (pathname === '/') {
dispatch({ type: 'preLogin', payload: { token } }); dispatch({ type: 'preLogin', payload: { token } });
} }
if (pathname === '/logout') {
localStorage.removeItem('token');
location.href = query.redirect;
}
}); });
}, },
}, },
......
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