Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
aef1e4a2
Commit
aef1e4a2
authored
Oct 31, 2017
by
ddcat1115
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #52
parent
748fd44b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
src/layouts/BasicLayout.js
src/layouts/BasicLayout.js
+9
-1
src/models/login.js
src/models/login.js
+15
-0
No files found.
src/layouts/BasicLayout.js
View file @
aef1e4a2
...
@@ -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
)
{
...
...
src/models/login.js
View file @
aef1e4a2
...
@@ -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
,
};
},
},
},
};
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment