import React, { Component } from 'react'; // 登录后才能跳转 class LinkAfterLogin extends Component { constructor(props) { super(props); } checkAuth = () => { if (this.props.checkIfLogin()) { this.props.history.push(this.props.to) } else { this.props.showLoginDialog() } } render() { return( {this.props.children} ) } } export default LinkAfterLogin;