king
2024-06-17 505ed1181c5c341ea24de8417f3909009ac68dfa
src/views/login/logincloudform.jsx
@@ -2,17 +2,11 @@
import PropTypes from 'prop-types'
import { Form, Input } from 'antd'
import { UserOutlined, LockOutlined } from '@ant-design/icons'
import zhCN from '@/locales/zh-CN/login.js'
import enUS from '@/locales/en-US/login.js'
import './index.scss'
class HeaderLoginForm extends Component {
  static propTpyes = {
    handleSubmit: PropTypes.func
  }
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
  }
  handleConfirm = () => {
@@ -60,12 +54,12 @@
      <Form style={{margin: '0px 10px'}}>
        <Form.Item>
          {getFieldDecorator('cloudusername', {
            rules: [{ required: true, message: this.state.dict['login.username.empty'] }],
            rules: [{ required: true, message: '请输入用户名' }],
            initialValue: '',
          })(
            <Input
              prefix={<UserOutlined style={{ color: 'rgba(0,0,0,.25)' }} />}
              placeholder={this.state.dict['login.username']}
              placeholder="用户名"
              autoComplete="off"
              onPressEnter={(e) => {this.handleSubmit(e, 'cloudpassword')}}
            />
@@ -77,10 +71,10 @@
            rules: [
              {
                required: true,
                message: this.state.dict['login.password.empty'],
                message: '请输入密码',
              }
            ]
          })(<Input.Password onPressEnter={(e) => {this.handleSubmit(e, 'cloudusername')}} placeholder={this.state.dict['login.password']} prefix={<LockOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} />)}
          })(<Input.Password onPressEnter={(e) => {this.handleSubmit(e, 'cloudusername')}} placeholder="密码" prefix={<LockOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} />)}
        </Form.Item>
      </Form>
    )