Add auto import react and antd
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
import React, { useState } from 'react'
|
||||
import { Button, Form, Input, message } from 'antd'
|
||||
import { LockOutlined, UserOutlined } from '@ant-design/icons'
|
||||
import React from 'react'
|
||||
import { login } from '@/utils/auth.ts'
|
||||
import { LOGIN_SUCCESS, LOGIN_USERNAME_PASSWORD_ERROR } from '@/constants/Common.constants.ts'
|
||||
import { setToken } from '@/utils/common.ts'
|
||||
import { useNavigate } from 'react-router'
|
||||
import '@/assets/css/login.css'
|
||||
|
||||
const Login: React.FC = () => {
|
||||
@@ -59,36 +56,36 @@ const Login: React.FC = () => {
|
||||
<div className={'login-from-text'}>
|
||||
<span>登 录</span>
|
||||
</div>
|
||||
<Form
|
||||
<AntdForm
|
||||
name="login-form"
|
||||
autoComplete="on"
|
||||
onFinish={onFinish}
|
||||
className={'login-from'}
|
||||
>
|
||||
<Form.Item
|
||||
<AntdForm.Item
|
||||
className={'login-from-item'}
|
||||
name={'username'}
|
||||
rules={[{ required: true, message: '用户名为空' }]}
|
||||
>
|
||||
<Input
|
||||
<AntdInput
|
||||
prefix={<UserOutlined />}
|
||||
placeholder={'用户名'}
|
||||
disabled={isLoggingIn}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
</AntdForm.Item>
|
||||
<AntdForm.Item
|
||||
className={'login-from-item'}
|
||||
name={'password'}
|
||||
rules={[{ required: true, message: '密码为空' }]}
|
||||
>
|
||||
<Input.Password
|
||||
<AntdInput.Password
|
||||
prefix={<LockOutlined />}
|
||||
placeholder={'密码'}
|
||||
disabled={isLoggingIn}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item className={'login-from-item'}>
|
||||
<Button
|
||||
</AntdForm.Item>
|
||||
<AntdForm.Item className={'login-from-item'}>
|
||||
<AntdButton
|
||||
style={{ width: '100%' }}
|
||||
type={'primary'}
|
||||
htmlType={'submit'}
|
||||
@@ -96,9 +93,9 @@ const Login: React.FC = () => {
|
||||
loading={isLoggingIn}
|
||||
>
|
||||
登    录
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</AntdButton>
|
||||
</AntdForm.Item>
|
||||
</AntdForm>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user