Skip to content
This repository was archived by the owner on May 7, 2022. It is now read-only.

Commit 2bdbceb

Browse files
author
yongyue.huang
committed
重定向
1 parent 8088b30 commit 2bdbceb

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/components/BaseLayout/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,11 @@ class BaseLayout extends React.Component {
371371
}))
372372
}
373373
redirectRoute = () => {
374-
const { isLogin } = this.props
375-
console.log(isLogin)
374+
const { isLogin, location, history } = this.props
376375
if (isLogin) {
377-
this.props.history.push('/admin')
376+
history.push(location.pathname)
378377
} else {
379-
this.props.history.push('/login')
378+
history.push('/login')
380379
}
381380
}
382381
onLogout = () => {
@@ -390,7 +389,6 @@ class BaseLayout extends React.Component {
390389
const { routes = [] } = this.props
391390
const { menuData, currentMenu } = this.state
392391
const list = menuData.list
393-
console.log(currentMenu)
394392
return (
395393
<Layout className="base-layout">
396394
<Sider>

src/reducers/global.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export const global = (state = initState, action) => {
1212
globalLoading: action.globalLoading
1313
}
1414
case "CHECK_IS_LOGIN":
15-
console.log(11111)
1615
sessionStorage.setItem('isLogin', action.isLogin)
1716
return {
1817
...state,

0 commit comments

Comments
 (0)