{"size": 435, "ext": "js", "max_stars_repo_path": "react/37.react/router/components/Login.js", "max_stars_repo_name": "webfrontup/mini-node", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "react/37.react/router/components/Login.js", "max_issues_repo_name": "webfrontup/mini-node", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "react/37.react/router/components/Login.js", "max_forks_repo_name": "webfrontup/mini-node", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.0, "max_line_length": 90, "alphanum_fraction": 0.5908045977}
import React,{Component} from 'react';
import PropTypes from 'prop-types';
export default class Login extends Component{
   handleClick=()=>{
      localStorage.setItem('login',true);
     this.props.history.push(this.props.location.state.from);
   }
   render(){
       return (
           <div>
               <button onClick={this.handleClick} className="btn btn-primary">登录</button>
           </div>
       );
   }
}