--- order: 0 title: Standard Login --- 支持账号密码及手机号登录两种模式。 ````jsx import Login from 'ant-design-pro/lib/Login'; import { Alert, Checkbox } from 'antd'; const { Tab, UserName, Password, Mobile, Captcha, Submit } = Login; class LoginDemo extends React.Component { state = { notice: '', type: 'tab2', autoLogin: true, } onSubmit = (err, values) => { console.log(`value collected ->`, {...values, autoLogin: this.state.autoLogin}); if (this.state.type === 'tab1') { this.setState({ notice: '', }, () => { if (!err && (values.username !== 'admin' || values.password !== '888888')) { setTimeout(() => { this.setState({ notice: '账号或密码错误!', }) }, 500); } }) } } onTabChange = (key) => { this.setState({ type: key, }) } changeAutoLogin = (e) => { this.setState({ autoLogin: e.target.checked, }) } render() { return ( { this.state.notice && } console.log('Get captcha!')} name="captcha" />
自动登录 忘记密码
登录
其他登录方式 注册账户
) } } ReactDOM.render(, mountNode); ````