Commit a27d9604 authored by 神楽坂玲奈's avatar 神楽坂玲奈

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/models/auth.js
#	src/routes/Index.js
parents 861e9909 bcd4546f
This diff is collapsed.
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
signOut(state) { signOut(state) {
console.log('sign out'); console.log('sign out');
localStorage.removeItem('token'); localStorage.removeItem('token');
localStorage.removeItem('user'); location.href = '/';
return state; return state;
}, },
change(state, action) { change(state, action) {
......
...@@ -29,5 +29,4 @@ function mapStateToProps(state) { ...@@ -29,5 +29,4 @@ function mapStateToProps(state) {
loading, loading,
}; };
} }
export default connect(mapStateToProps)(Active); export default connect(mapStateToProps)(Active);
...@@ -124,12 +124,12 @@ const particleConfig = { ...@@ -124,12 +124,12 @@ const particleConfig = {
function Index({ children, messages, dispatch }) { function Index({ children, messages, dispatch }) {
return ( return (
<div style={{ display: 'flex', flexDirection: 'column', minHeight: '100%' }}> <div style={{ height: '100%'}}>
<DocumentTitle title={messages.title || 'Moe Cube'}/> <DocumentTitle title={messages.title || 'Moe Cube'} />
<Header style={{ display: 'flex', alignItems: 'center' }}> <Header style={{ display: 'flex', alignItems: 'center' }}>
<Link to="/" style={{ marginTop: '20px' }}> <Link to="/" style={{ marginTop: '20px' }}>
<img src={logo} style={{ width: '140px', height: '44px' }} alt="logo"/> <img src={logo} style={{ width: '140px', height: '44px' }}/>
</Link> </Link>
<Menu <Menu
...@@ -151,15 +151,11 @@ function Index({ children, messages, dispatch }) { ...@@ -151,15 +151,11 @@ function Index({ children, messages, dispatch }) {
defaultSelectedKeys={['1']} defaultSelectedKeys={['1']}
style={{ lineHeight: '64px', position: 'absolute', right: '50px' }} style={{ lineHeight: '64px', position: 'absolute', right: '50px' }}
> >
{localStorage.getItem('user') ? (<Menu.Item key="1"> {localStorage.getItem('token') ? (<Menu.Item key="1">
<div <div onClick={() => { dispatch({ type : 'auth/signOut' }) }}>
onClick={() => {
dispatch({ type: 'auth/signOut' });
}}
>
<Format id="sign-out"/> <Format id="sign-out"/>
</div> </div>
</Menu.Item>) : (<div/>) </Menu.Item>):('')
} }
</Menu> </Menu>
</Header> </Header>
...@@ -172,7 +168,7 @@ function Index({ children, messages, dispatch }) { ...@@ -172,7 +168,7 @@ function Index({ children, messages, dispatch }) {
/> />
{children} {children}
<Footer style={{ position: 'absolute', width: '100%' }}> <Footer style={{ position: 'absolute', width: '100%'}}>
<div>© MoeCube 2017 all right reserved.</div> <div>© MoeCube 2017 all right reserved.</div>
</Footer> </Footer>
</div> </div>
......
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