| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Icon, Input, Button, Checkbox, Select, Modal, message } from 'antd' |
| | | import { Form, Input, Button, Checkbox, Select, Modal, message } from 'antd' |
| | | import { UserOutlined, LockOutlined, QrcodeOutlined, RedoOutlined } from '@ant-design/icons' |
| | | import md5 from 'md5' |
| | | import moment from 'moment' |
| | | |
| | |
| | | return ( |
| | | <Form className="login-form" id="login-form" onSubmit={this.handleSubmit}> |
| | | <div className="login-way-title">{wayLabels[activeKey]}</div> |
| | | {hasScan && activeKey !== 'app_scan' ? <div className="scan-icon" onClick={() => this.onChangeTab('app_scan')}><Icon type="qrcode" /></div> : null} |
| | | {hasScan && activeKey !== 'app_scan' ? <div className="scan-icon" onClick={() => this.onChangeTab('app_scan')}><QrcodeOutlined /></div> : null} |
| | | {activeKey === 'uname_pwd' ? <div className="form-item-wrap"> |
| | | <Form.Item> |
| | | {getFieldDecorator('username', { |
| | |
| | | initialValue: this.state.username || '', |
| | | })( |
| | | <Input |
| | | prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />} |
| | | prefix={<UserOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} |
| | | placeholder={this.props.dict['login.username']} |
| | | autoComplete="off" |
| | | />, |
| | |
| | | message: this.props.dict['login.password.empty'], |
| | | } |
| | | ] |
| | | })(<Input.Password placeholder={this.props.dict['login.password']} prefix={<Icon type="lock" style={{ color: 'rgba(0,0,0,.25)' }} />} />)} |
| | | })(<Input.Password placeholder={this.props.dict['login.password']} prefix={<LockOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} />)} |
| | | </Form.Item> |
| | | <Form.Item className="minline"> |
| | | {getFieldDecorator('remember', { |
| | |
| | | <div className="qr-wrap"> |
| | | {scanId ? <QrCode card={{qrWidth: 500, color: '#000000'}} value={`mkpcscan,${window.GLOB.appkey},${scanId}`}/> : null} |
| | | {timeout ? <div className="qrcode-out"> |
| | | <Icon onClick={this.reCode} type="redo" /> |
| | | <RedoOutlined onClick={this.reCode} /> |
| | | 二维码已失效。 |
| | | </div> : null} |
| | | </div> |