import React, { Component } from 'react'
import PropTypes from 'prop-types'
import styles from './index.less'
import { LOG, LOGERR } from 'utils'

class Oauth extends Component {
    static propTypes = {
        onRedirect: PropTypes.func
    }
    static defaultProps = {
        onRedirect: (url) => {
            LOGERR(`missing onRedirect props，it's required. please check the Oauth component`)
            // location.href = url
        }
    }

    componentWillMount () {
        LOG(this.props)
        // LOG(getQueryString('code'))
    }

    componentDidMount () {
        this.props.onRedirect('/')
    }

    render () {
        return (
            <div className={styles.oauth}>信息同步中<span className={styles.dotting} /></div>
        )
    }
}
export default Oauth
