|
|
|
@ -1,10 +1,9 @@ |
|
|
|
|
// login.tsx 最简测试版本
|
|
|
|
|
import { FC } from 'react'; |
|
|
|
|
import { Button, Form, Input, Spin, notification } from 'antd'; |
|
|
|
|
import { Button, Form, Input, Spin, notification ,Image} from 'antd'; |
|
|
|
|
import { useRouter } from 'next/router'; |
|
|
|
|
import { STORAGE_USERINFO_KEY, STORAGE_USERINFO_VALID_TIME_KEY } from '@/utils/constants/index'; |
|
|
|
|
import { doLogin } from '@/client/api'; |
|
|
|
|
import { Role, UserInfoResponse } from '@/types/userinfo'; |
|
|
|
|
import { useRequest } from 'ahooks'; |
|
|
|
|
|
|
|
|
|
const LoginPage: FC = () => { |
|
|
|
@ -40,26 +39,53 @@ const LoginPage: FC = () => { |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div className="flex justify-center items-center h-screen"> |
|
|
|
|
<div className="w-96 p-6 bg-white rounded-lg shadow-lg"> |
|
|
|
|
<h1 className="text-2xl mb-4 text-center">系统登录</h1> |
|
|
|
|
<Form onFinish={(values) => doLoginFn(values)}> |
|
|
|
|
<Form.Item name="username" rules={[{ required: true, message: '请输入用户名' }]}> |
|
|
|
|
<Input placeholder="用户名" /> |
|
|
|
|
</Form.Item> |
|
|
|
|
<Form.Item name="password" rules={[{ required: true, message: '请输入密码' }]}> |
|
|
|
|
<Input.Password placeholder="密码" /> |
|
|
|
|
</Form.Item> |
|
|
|
|
<Button |
|
|
|
|
type="primary" |
|
|
|
|
htmlType="submit" |
|
|
|
|
block |
|
|
|
|
icon={loading ? <Spin className="mr-2" /> : null} |
|
|
|
|
disabled={loading} |
|
|
|
|
> |
|
|
|
|
{loading ? '登录中...' : '登录'} |
|
|
|
|
</Button> |
|
|
|
|
</Form> |
|
|
|
|
<div className="relative h-screen w-screen overflow-hidden"> |
|
|
|
|
{/* 视频背景 */} |
|
|
|
|
<video |
|
|
|
|
autoPlay |
|
|
|
|
loop |
|
|
|
|
muted |
|
|
|
|
className="absolute inset-0 h-full w-full object-cover" |
|
|
|
|
style={{ zIndex: 0 }} |
|
|
|
|
> |
|
|
|
|
<source src="/0001-0096.mp4" type="video/mp4" /> |
|
|
|
|
您的浏览器不支持视频标签。 |
|
|
|
|
</video> |
|
|
|
|
|
|
|
|
|
{/* 登录表单容器 */} |
|
|
|
|
<div className="relative z-10 flex h-full items-center justify-end pr-24"> |
|
|
|
|
<div className="w-96 rounded-lg bg-white bg-opacity-90 p-6 shadow-lg backdrop-blur-sm"> |
|
|
|
|
|
|
|
|
|
<Image |
|
|
|
|
width={'100%'} |
|
|
|
|
preview={false} |
|
|
|
|
src="/LOGO_1.png" |
|
|
|
|
/> |
|
|
|
|
<Form onFinish={(values) => doLoginFn(values)}> |
|
|
|
|
{/* 保持原有表单项目不变 */} |
|
|
|
|
<Form.Item |
|
|
|
|
name="username" |
|
|
|
|
rules={[{ required: true, message: '请输入用户名' }]} |
|
|
|
|
> |
|
|
|
|
<Input placeholder="用户名" /> |
|
|
|
|
</Form.Item> |
|
|
|
|
<Form.Item |
|
|
|
|
name="password" |
|
|
|
|
rules={[{ required: true, message: '请输入密码' }]} |
|
|
|
|
> |
|
|
|
|
<Input.Password placeholder="密码" /> |
|
|
|
|
</Form.Item> |
|
|
|
|
<Button |
|
|
|
|
type="primary" |
|
|
|
|
htmlType="submit" |
|
|
|
|
block |
|
|
|
|
icon={loading ? <Spin className="mr-2" /> : null} |
|
|
|
|
disabled={loading} |
|
|
|
|
> |
|
|
|
|
{loading ? '登录中...' : '登录'} |
|
|
|
|
</Button> |
|
|
|
|
</Form> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
); |
|
|
|
|