Commit fa2eccfc by zhanghaozhe

修复未登录跳转丢失id问题

parent 41da80ff
...@@ -17,6 +17,11 @@ import { Toast } from "antd-mobile"; ...@@ -17,6 +17,11 @@ import { Toast } from "antd-mobile";
class AccountLogin extends PureComponent { class AccountLogin extends PureComponent {
componentDidMount() {
console.log(this.props.location);
}
render() { render() {
const { const {
errors, errors,
...@@ -73,8 +78,8 @@ const formikConfig = { ...@@ -73,8 +78,8 @@ const formikConfig = {
username, password username, password
}).then(res => { }).then(res => {
if (!res.hasError) { if (!res.hasError) {
let {from} = props.location.state || {from: {pathname: '/'}} let {from} = props.location.state || {from: {pathname: '/', search: ''}}
history.replace(from.pathname) history.replace({pathname: from.pathname, search: from.search})
} else { } else {
Toast.info(res.msg, 2, null, false) Toast.info(res.msg, 2, null, false)
} }
......
...@@ -21,7 +21,6 @@ class Passport extends Component { ...@@ -21,7 +21,6 @@ class Passport extends Component {
redirect_url = location.protocol + '//' + location.hostname redirect_url = location.protocol + '//' + location.hostname
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
......
...@@ -103,7 +103,8 @@ export default [ ...@@ -103,7 +103,8 @@ export default [
}, },
{ {
path: '/play', path: '/play',
component: Video component: Video,
isPrivate: true
}, },
{ {
path: '/scholarship', path: '/scholarship',
......
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