import { styled } from "styled-components" import LoginBg from '@/assets/login_bg.jpg'; import CCLogo from '@/assets/logo.png'; import { LockOutlined, UserOutlined } from '@ant-design/icons'; import { Button, Form, Input, message } from 'antd'; import { userStore } from "../store/userStore"; import { useNavigate } from "react-router-dom"; const LoginWrapper = styled.div` width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: flex-start; background-color: #f2f5f7; ` const Sider = styled.div` width: 400px; background-image: url(${LoginBg}); height: 100%; flex-direction: column; display: flex; align-items: center; justify-content: center; position: relative; ` const SiderLogo = styled.img` height: 40px; object-fit: cover; position: absolute; top: 20px; left: 30px; z-index: 10; ` const SiderTitle = styled.div` font-size: 24px; color: white; width: 100%; box-sizing: border-box; padding-left: 50px; ` const Description = styled.div` font-size: 14px; color: white; width: 100%; box-sizing: border-box; padding-left: 50px; margin-top: 30px; ` const Content = styled.div` height: 100%; flex: 1; display: flex; align-items: center; justify-content: center; ` const LoginBox = styled.div` width: 400px; height: 300px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; ` const Login = () => { const navigate = useNavigate(); const onFinish = async (values: Record) => { try { await userStore.login({ username: values.username, password: '', }) void message.success('登录成功, 欢迎使用CCFlowForReact'); navigate("/", { replace: true }) } catch (err: any) { void message.error(err.toString()); } }; return ( <> CCFlow Toolkit For React 包含以下功能 1. 流程发起 / 待办 / 查询 2. 流程统计分析 3. CCFlow后端Rest接口Swagger文档
登录到 CCFlow
} placeholder="用户名" /> } type="password" placeholder="密码" />
) } export default Login