Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Moecube Accounts Web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
MyCard
Moecube Accounts Web
Commits
042cdaa5
Commit
042cdaa5
authored
Jun 23, 2018
by
IamI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Logout
parent
51f90420
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
src/router.js
src/router.js
+4
-0
src/routes/Logout.js
src/routes/Logout.js
+25
-0
No files found.
src/router.js
View file @
042cdaa5
...
...
@@ -9,6 +9,8 @@ import Index from './routes/Index.js';
import
Login
from
'
./routes/Login.js
'
;
import
Logout
from
'
./routes/Logout.js
'
import
Profiles
from
'
./routes/Profiles.js
'
;
import
Register
from
'
./routes/Register.js
'
;
...
...
@@ -23,6 +25,8 @@ function RouterConfig({ history }) {
<
Router
history
=
{
history
}
>
<
Route
path
=
"
/
"
component
=
{
Index
}
>
<
Route
path
=
"
/signin
"
component
=
{
Login
}
/
>
<
Route
path
=
"
/signout
"
component
=
{
Logout
}
/
>
<
Route
path
=
"
/forgot
"
component
=
{
Forgot
}
/
>
<
Route
path
=
"
/signup
"
component
=
{
Register
}
/
>
<
Route
path
=
"
/reset
"
component
=
{
Reset
}
/
>
...
...
src/routes/Logout.js
0 → 100644
View file @
042cdaa5
import
{
connect
}
from
'
dva
'
;
import
React
from
'
react
'
;
class
Logout
extends
React
.
Component
{
componentDidMount
()
{
window
.
localStorage
.
removeItem
(
'
token
'
);
const
url
=
new
URL
(
window
.
location
.
href
);
const
redirect
=
url
.
searchParams
.
get
(
'
redirect
'
)
||
'
/
'
;
window
.
location
.
href
=
redirect
;
}
render
()
{
return
null
;
}
}
function
mapStateToProps
(
state
)
{
const
loading
=
state
.
loading
.
global
||
false
;
return
{
loading
,
};
}
export
default
connect
(
mapStateToProps
)(
Logout
);
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