--- order: 0 title: zh-CN: 标准登录 en-US: Standard Login --- Support login with account and mobile number. ````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: 'The combination of username and password is incorrect!', }); }, 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" />
Keep me logged in Forgot password
Login
Other login methods Register
); } } ReactDOM.render(, mountNode); ````