Commit 7ec178ee by zhanghaozhe

temp

parent df4b76a5
...@@ -59,6 +59,8 @@ class App extends Component { ...@@ -59,6 +59,8 @@ class App extends Component {
const routeMatchRule = /binding-tel|forgot|set-password/ const routeMatchRule = /binding-tel|forgot|set-password/
const {history} = this.props const {history} = this.props
history.listen((location) => { history.listen((location) => {
console.log(this.props.location);
console.log(location);
this.setNavigationRecord(location) this.setNavigationRecord(location)
if (cookie.get('uid') && this.props.user.hasError) { if (cookie.get('uid') && this.props.user.hasError) {
this.getUser() this.getUser()
...@@ -68,7 +70,7 @@ class App extends Component { ...@@ -68,7 +70,7 @@ class App extends Component {
if (routeMatchRule.test(pathname)) { if (routeMatchRule.test(pathname)) {
return return
} }
location.state = {from: this.previousLocation}; location.state = {...location.state, ...{from: this.previousLocation}};
} }
}) })
...@@ -86,6 +88,7 @@ class App extends Component { ...@@ -86,6 +88,7 @@ class App extends Component {
[{pathname: location.pathname, search: '', hash: ''}] [{pathname: location.pathname, search: '', hash: ''}]
} }
} }
// console.log(location.state.record);
} }
getUser = () => { getUser = () => {
......
...@@ -14,6 +14,7 @@ class HeaderBar extends Component { ...@@ -14,6 +14,7 @@ class HeaderBar extends Component {
window.history.go(-2) window.history.go(-2)
} }
if(state.record && state.record.length > 1){ if(state.record && state.record.length > 1){
console.log(state.record.length);
window.history.go(-1); window.history.go(-1);
}else{ }else{
window.location.href = window.location.origin window.location.href = window.location.origin
......
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