Commit fa2eccfc by zhanghaozhe

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

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