| | |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { loginWays, wrap } = this.props |
| | | const { wrap } = this.props |
| | | |
| | | if (!is(fromJS(wrap), fromJS(nextProps.wrap))) { |
| | | let _loginWays = [] |
| | | loginWays.forEach(item => { |
| | | nextProps.loginWays.forEach(item => { |
| | | if (!nextProps.wrap.loginWays || nextProps.wrap.loginWays.includes(item.type)) { |
| | | _loginWays.push(item) |
| | | } |
| | |
| | | <div className={'login-way' + (activeWay.type === item.type ? ' active' : '')} onClick={() => this.onChangeTab(item)} key={item.type}>{item.label}</div> |
| | | ))} |
| | | </div> |
| | | {activeWay.type === 'uname_pwd' ? <div className="form-item-wrap"> |
| | | {activeWay.type === 'uname_pwd' ? <div className={'form-item-wrap ' + (activeWay.shortcut === 'none' ? 'no-short' : '')}> |
| | | <Form.Item> |
| | | <Input |
| | | prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />} |
| | |
| | | <Form.Item> |
| | | <Input.Password placeholder="密码" prefix={<Icon type="lock" style={{ color: 'rgba(0,0,0,.25)' }} />} /> |
| | | </Form.Item> |
| | | <Form.Item className="minline"> |
| | | {!activeWay.shortcut || activeWay.shortcut === 'remember' ? <Form.Item className="minline"> |
| | | <Checkbox>记住密码</Checkbox> |
| | | </Form.Item> |
| | | </Form.Item> : null} |
| | | {activeWay.shortcut === 'autologon' ? <Form.Item className="minline"> |
| | | <Checkbox>自动登录</Checkbox> |
| | | </Form.Item> : null} |
| | | <Form.Item className="btn-login"> |
| | | <Button type="primary" onDoubleClick={() => this.changeMenu()} className="login-form-button"> |
| | | 登录 |