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
87ca9fd5
Commit
87ca9fd5
authored
Jan 17, 2018
by
jim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #729 prevent pollution url history
parent
df93c649
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
src/layouts/BasicLayout.js
src/layouts/BasicLayout.js
+8
-3
src/models/login.js
src/models/login.js
+1
-1
No files found.
src/layouts/BasicLayout.js
View file @
87ca9fd5
...
@@ -102,10 +102,15 @@ class BasicLayout extends React.PureComponent {
...
@@ -102,10 +102,15 @@ class BasicLayout extends React.PureComponent {
// According to the url parameter to redirect
// According to the url parameter to redirect
// 这里是重定向的,重定向到 url 的 redirect 参数所示地址
// 这里是重定向的,重定向到 url 的 redirect 参数所示地址
const
urlParams
=
new
URL
(
window
.
location
.
href
);
const
urlParams
=
new
URL
(
window
.
location
.
href
);
const
redirect
=
urlParams
.
searchParams
.
get
(
'
redirect
'
)
||
'
/dashboard/analysis
'
;
const
redirect
=
urlParams
.
searchParams
.
get
(
'
redirect
'
);
// Remove the parameters in the url
// Remove the parameters in the url
urlParams
.
searchParams
.
delete
(
'
redirect
'
);
if
(
redirect
)
{
window
.
history
.
pushState
(
null
,
'
redirect
'
,
urlParams
.
href
);
urlParams
.
searchParams
.
delete
(
'
redirect
'
);
window
.
history
.
replaceState
(
null
,
'
redirect
'
,
urlParams
.
href
);
}
else
{
return
'
/dashboard/analysis
'
;
}
return
redirect
;
return
redirect
;
}
}
handleMenuCollapse
=
(
collapsed
)
=>
{
handleMenuCollapse
=
(
collapsed
)
=>
{
...
...
src/models/login.js
View file @
87ca9fd5
...
@@ -31,7 +31,7 @@ export default {
...
@@ -31,7 +31,7 @@ export default {
const
pathname
=
yield
select
(
state
=>
state
.
routing
.
location
.
pathname
);
const
pathname
=
yield
select
(
state
=>
state
.
routing
.
location
.
pathname
);
// add the parameters in the url
// add the parameters in the url
urlParams
.
searchParams
.
set
(
'
redirect
'
,
pathname
);
urlParams
.
searchParams
.
set
(
'
redirect
'
,
pathname
);
window
.
history
.
push
State
(
null
,
'
login
'
,
urlParams
.
href
);
window
.
history
.
replace
State
(
null
,
'
login
'
,
urlParams
.
href
);
}
finally
{
}
finally
{
// yield put(routerRedux.push('/user/login'));
// yield put(routerRedux.push('/user/login'));
// Login out after permission changes to admin or user
// Login out after permission changes to admin or user
...
...
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