提交 77ed35eb 作者: ZhangLingKun

功能:登录页面

上级 a841a166
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1680765634963" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3383" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M698.4 313.8h135L697.4 165l1 148.8z m-422.7 452c-14.9 0.1-27.1-12-27.1-26.9-0.1-14.9 12-27.1 26.9-27.1l484.4-1.9c14.9-0.1 27.1 12 27.1 26.9 0.1 14.9-12 27.1-26.9 27.1l-484.4 1.9z m0-196.1c-14.9 0.1-27.1-12-27.1-26.9-0.1-14.9 12-27.1 26.9-27.1l484.4-1.9c14.9-0.1 27.1 12 27.1 26.9 0.1 14.9-12 27.1-26.9 27.1l-484.4 1.9z m9.1-203.7c-14.9 0-27-12.1-27-27s12.1-27 27-27h294.4c14.9 0 27 12.1 27 27s-12.1 27-27 27H284.8zM98.6 127.2c0-34.9 28-63.2 62.9-63.2h499.6c17.6 0 38.4 9.2 50.2 22.3l194.9 215.5c11.2 12.3 19.1 32.8 19.1 49.5v545.6c0 34.9-28.2 63.2-63 63.2H161.6c-34.9 0-63-28.2-63-63.2V127.2z m545.2-9.1H161.5c-4.9 0-8.9 4-8.9 9.1v769.6c0 5.2 4 9.1 8.9 9.1h700.8c4.9 0 8.9-4.1 8.9-9.1V365.6c-6.8 1.4-14.6 2.2-23.3 2.2H680.7c-19.9 0-36.1-16.1-36.2-36.1l-1.2-198.9c-0.2-5.2 0.1-10.2 0.5-14.7z" fill="#1677ff" p-id="3384"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1681542784819" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2665" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M530.432 148.736c-226.176 0-409.6 151.808-409.6 339.2s183.424 339.2 409.6 339.2c36.224 0 34.816 100.224 26.112 152.192-1.152 7.296 7.808 11.776 12.928 6.4 44.288-45.824 151.808-157.696 254.848-261.632 71.552-61.056 115.712-144.384 115.712-236.288 0-187.264-183.424-339.072-409.6-339.072z m-192 409.6c-35.328 0-64-28.672-64-64s28.672-64 64-64 64 28.672 64 64-28.672 64-64 64z m192 0c-35.328 0-64-28.672-64-64s28.672-64 64-64 64 28.672 64 64-28.672 64-64 64z m192 0c-35.328 0-64-28.672-64-64s28.672-64 64-64 64 28.672 64 64-28.672 64-64 64z" fill="#333333" p-id="2666"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1663035641973" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2444" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M379.733333 355.84c-5.973333 0-10.24-4.266667-10.24-10.24s4.266667-10.24 10.24-10.24h358.4c5.973333 0 10.24 4.266667 10.24 10.24s-4.266667 10.24-10.24 10.24h-358.4zM379.733333 446.293333c-5.973333 0-10.24-4.266667-10.24-10.24s4.266667-10.24 10.24-10.24h358.4c5.973333 0 10.24 4.266667 10.24 10.24s-4.266667 10.24-10.24 10.24h-358.4zM605.866667 693.76c-5.973333 0-10.24-4.266667-10.24-10.24s4.266667-10.24 10.24-10.24h120.32c5.973333 0 10.24 4.266667 10.24 10.24s-4.266667 10.24-10.24 10.24H605.866667zM721.066667 217.6c-5.973333 0-10.24-4.266667-10.24-10.24s4.266667-10.24 10.24-10.24h17.066666c5.973333 0 10.24 4.266667 10.24 10.24s-4.266667 10.24-10.24 10.24h-17.066666zM550.4 217.6c-5.973333 0-10.24-4.266667-10.24-10.24s4.266667-10.24 10.24-10.24h17.066667c5.973333 0 10.24 4.266667 10.24 10.24s-4.266667 10.24-10.24 10.24h-17.066667zM635.733333 217.6c-5.973333 0-10.24-4.266667-10.24-10.24s4.266667-10.24 10.24-10.24h17.066667c5.973333 0 10.24 4.266667 10.24 10.24s-4.266667 10.24-10.24 10.24h-17.066667zM379.733333 217.6c-5.973333 0-10.24-4.266667-10.24-10.24s4.266667-10.24 10.24-10.24h17.066667c5.973333 0 10.24 4.266667 10.24 10.24s-4.266667 10.24-10.24 10.24h-17.066667zM465.066667 217.6c-5.973333 0-10.24-4.266667-10.24-10.24s4.266667-10.24 10.24-10.24h17.066666c5.973333 0 10.24 4.266667 10.24 10.24s-4.266667 10.24-10.24 10.24h-17.066666z" p-id="2445"></path><path d="M279.893333 954.88c-8.533333 0-17.92-1.706667-25.6-5.973333C133.973333 935.253333 42.666667 832 42.666667 710.826667c0-107.52 71.68-202.24 175.786666-231.253334V130.56c0-34.133333 27.306667-61.44 61.44-61.44H836.266667c34.133333 0 61.44 27.306667 61.44 61.44V776.533333c0 2.56-0.853333 5.12-2.56 6.826667l-167.253334 168.96c-0.853333 0.853333-2.56 1.706667-3.413333 2.56-0.853333 0.853333-2.56 0.853333-4.266667 0.853333H279.893333z m430.08-20.48V827.733333c0-34.133333 27.306667-61.44 61.44-61.44h105.813334V130.56c0-22.186667-18.773333-40.96-40.96-40.96H279.893333c-22.186667 0-40.96 18.773333-40.96 40.96v343.893333c14.506667-2.56 29.866667-4.266667 44.373334-4.266666 50.346667 0 98.133333 15.36 139.093333 44.373333h314.88c5.973333 0 10.24 4.266667 10.24 10.24s-4.266667 10.24-10.24 10.24h-290.133333c48.64 45.226667 75.946667 109.226667 75.946666 175.786667 0 98.986667-61.44 187.733333-152.746666 223.573333h339.626666z m-426.666666-443.733333c-15.36 0-30.72 1.706667-46.08 5.12-5.973333 0.853333-11.093333 2.56-17.066667 4.266666C128 527.36 63.146667 614.4 63.146667 710.826667c0 100.693333 68.266667 188.586667 166.4 213.333333 10.24 2.56 20.48 4.266667 29.866666 5.12 7.68 0.853333 15.36 0.853333 23.04 0.853333 121.173333 0 220.16-98.986667 220.16-220.16 0-69.973333-32.426667-133.973333-87.893333-175.786666-8.533333-5.973333-17.066667-11.946667-26.453333-17.066667-30.72-17.066667-67.413333-26.453333-104.96-26.453333z m488.106666 296.106666c-22.186667 0-40.96 18.773333-40.96 40.96v92.16L861.866667 786.773333H771.413333z" p-id="2446"></path><path d="M409.6 824.32c-2.56 0-4.266667-0.853333-6.826667-2.56-1.706667-1.706667-3.413333-4.266667-3.413333-6.826667 0-2.56 0.853333-5.12 2.56-7.68 40.106667-48.64 46.08-118.613333 14.506667-173.226666-27.306667-46.933333-77.653333-75.946667-132.266667-75.946667-8.533333 0-16.213333 0.853333-24.746667 1.706667h-1.706666c-5.12 0-9.386667-3.413333-10.24-8.533334-0.853333-5.973333 2.56-11.093333 8.533333-11.946666 9.386667-1.706667 18.773333-2.56 27.306667-2.56 62.293333 0 119.466667 33.28 150.186666 86.186666 35.84 62.293333 29.013333 140.8-16.213333 196.266667-1.706667 3.413333-4.266667 5.12-7.68 5.12zM284.16 884.053333c-15.36 0-31.573333-2.56-46.933333-6.826666-5.973333-1.706667-11.946667-3.413333-17.066667-5.973334-36.693333-14.506667-66.56-40.96-86.186667-74.24-35.84-62.293333-29.013333-140.8 16.213334-196.266666 1.706667-2.56 5.12-3.413333 7.68-3.413334 2.56 0 4.266667 0.853333 6.826666 2.56 1.706667 1.706667 3.413333 4.266667 3.413334 6.826667 0 2.56-0.853333 5.12-2.56 7.68-40.106667 48.64-46.08 118.613333-14.506667 173.226667 16.213333 27.306667 40.106667 49.493333 69.973333 62.293333 5.973333 2.56 11.093333 5.12 17.066667 6.826667 15.36 5.12 30.72 6.826667 46.08 6.826666 8.533333 0 16.213333-0.853333 24.746667-1.706666h1.706666c5.12 0 9.386667 3.413333 10.24 8.533333 0.853333 5.973333-2.56 11.093333-8.533333 11.946667-9.386667 0.853333-18.773333 1.706667-28.16 1.706666z" p-id="2447"></path><path d="M228.693333 807.253333c-2.56 0-4.266667-0.853333-5.973333-1.706666-2.56-1.706667-3.413333-4.266667-4.266667-6.826667v-3.413333l9.386667-57.173334-41.813333-40.106666c-2.56-2.56-4.266667-6.826667-2.56-10.24 0.853333-3.413333 4.266667-6.826667 8.533333-6.826667l57.173333-8.533333 24.746667-52.053334c1.706667-3.413333 5.12-5.973333 9.386667-5.973333 4.266667 0 7.68 2.56 9.386666 5.973333l25.6 51.2 57.173334 7.68c4.266667 0.853333 6.826667 3.413333 8.533333 6.826667 0.853333 3.413333 0 7.68-2.56 10.24l-40.96 40.96 10.24 57.173333c0.853333 4.266667-0.853333 7.68-4.266667 10.24-1.706667 1.706667-4.266667 1.706667-5.973333 1.706667-1.706667 0-3.413333 0-4.266667-0.853333l-51.2-26.453334-51.2 27.306667c-1.706667 0-3.413333 0.853333-5.12 0.853333z m17.066667-80.213333c2.56 2.56 3.413333 5.973333 3.413333 9.386667l-6.826666 41.813333 37.546666-19.626667c1.706667-0.853333 3.413333-0.853333 5.12-0.853333 1.706667 0 3.413333 0 5.12 0.853333l37.546667 19.626667-7.68-41.813333c-0.853333-3.413333 0.853333-6.826667 2.56-9.386667l29.866667-29.866667-42.666667-5.973333c-3.413333-0.853333-5.973333-2.56-7.68-5.12L283.306667 648.533333 264.533333 686.08c-1.706667 3.413333-4.266667 5.12-7.68 5.973333l-41.813333 6.826667 30.72 28.16z" p-id="2448"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1663151229260" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5986" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M512 131.75C301.9484375 131.75 131.75 301.9484375 131.75 512s170.1984375 380.25 380.25 380.25 380.25-170.1984375 380.25-380.25S722.0515625 131.75 512 131.75z m-58.6828125 514.9828125c-4.3875 4.3875-10.603125 8.04375-16.0875 8.04375s-11.7-3.8390625-16.2703125-8.2265625l-102.375-102.375 32.540625-32.540625 86.2875 86.2875L665.5625 368.1265625l31.9921875 33.0890625-244.2375 245.5171875z" p-id="5987" fill="#1296db"></path></svg>
\ No newline at end of file
body{
background-color:rgb(245,246,250);
position: relative;
.login-warp{
width:100%;
height:100%;
padding-top:calc(((100vh - (576px / 5 * 4)) / 2) - 20px);
}
.login-view{
margin:0 auto;
width:calc(1200px / 5 * 4);
height:calc(600px / 5 * 4);
background-image:url(../../../assets/image/login.jpg);
background-size:100% 100%;
border-radius:16px;
overflow:hidden;
box-shadow:0px 20px 30px rgba(112,158,254,0.45);
display:flex;
flex-wrap: wrap;
.login-flex{
flex:1;
}
.login-content{
text-align:center;
color: #000;
.login-title{
margin-top: 158px;
font-size: 24px;
}
.login-text{
margin-top: 26px;
font-size: 20px;
}
.login-detail{
margin-top: 44px;
font-size: 13px;
color: rgba(0,0,0,.5);
}
}
.login-form{
.login-image{
margin: 62px auto 46px;
width: 84px;
height: 84px;
background-image:url(../../../assets/image/logo.png);
background-size:100%;
border: 4px #fff solid;
border-radius:50%;
box-shadow:3px 3px 30px #dddddd;
}
.login-input{
.ant-form-item{
line-height: 54px;
}
.ant-input-affix-wrapper{
background-color:#fff;
border-radius:22px;
line-height: 30px;
border: none;
box-shadow:3px 3px 30px #dddddd;
}
}
.login-password{
margin-bottom:-8px;
}
.login-remember{
margin-bottom: 0;
transform: scale(0.8);
.ant-checkbox-checked .ant-checkbox-inner {
background-color: rgb(102,122,255);
border-color: rgb(102,122,255);
}
}
.login-submit{
width:210px;
font-size:13px;
background:rgb(102,122,255);
border:rgb(102,122,255);
box-shadow:3px 3px 30px #dddddd;
}
}
}
}
import { Button, Checkbox, Form, Input } from 'antd';
import React, { useEffect } from 'react';
import { LockOutlined, UserOutlined } from '@ant-design/icons';
import { useNavigate } from 'react-router-dom';
import Cookies from 'js-cookie';
import './index.scss';
function LoginView() {
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment
// @ts-ignore
const navigate = useNavigate();
const [form] = Form.useForm();
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment
// @ts-ignore
const onFinish = async (values: any) => {
// props
// .login(values)
// .then(async (res: any) => {
// if (res.code === '200') {
// getUserRole();
// }
// })
// .catch((err: any) => {
// message.error('登录失败,请检查账号信息');
// });
};
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment
// @ts-ignore
const onFinishFailed = (errorInfo: any) => {
// console.log("Failed:", errorInfo);
};
useEffect(() => {
const remember = Cookies.get('remember');
// console.log("remember--->", remember);
if (remember === 'true') {
form.setFieldsValue({
accountNo: Cookies.get('username'),
passWord: Cookies.get('password'),
});
} else {
// console.log("执行了-->");
form.setFieldsValue({
remember: false,
});
}
}, []);
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment
// @ts-ignore
const getUserRole = async () => {
// const res: any = await RoleAPI.getListCuserMenuInfo();
// if (res.result && res.result.length != 0) {
// localStorage.setItem('routeList', JSON.stringify(res.result || []));
// // console.log("存在的路由--->", getFirstRoute(res.result, route));
// history.push(getFirstRoute(res.result, route)[0].path);
// } else {
// message.warning('请先配置权限');
// }
};
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment
// @ts-ignore
const getFirstRoute = (routeList: any[], list: any) => {
// return list.reduce((pre: any, cur: any) => {
// const bol: boolean = routeList.some((i) => i.id === cur.id);
// if (bol && cur.children) {
// pre.push(...getFirstRoute(routeList, cur.children));
// }
// if (bol && !cur.children) {
// pre.push(cur);
// }
// return pre;
// }, []);
};
return (
<div className='login-warp'>
<div className='login-view'>
<div className='login-flex login-content'>
<div className='login-title'>欢迎来到</div>
<div className='login-text'>科比特 · 云享飞管理平台</div>
<div className='login-detail'>让天空为世界所用</div>
</div>
<div className='login-flex login-form'>
<div className='login-image' />
<div className='login-input'>
<Form
name='basic'
form={form}
wrapperCol={{ span: 16, offset: 4 }}
initialValues={{ remember: true }}
onFinish={onFinish}
onFinishFailed={onFinishFailed}
autoComplete='off'
>
<Form.Item name='accountNo' rules={[{ required: true, message: '请输入用户名' }]}>
<Input size='large' prefix={<UserOutlined />} placeholder='请输入账号' allowClear />
</Form.Item>
<Form.Item
name='passWord'
className='login-password'
rules={[{ required: true, message: '请输入密码' }]}
>
<Input.Password
size='large'
prefix={<LockOutlined />}
placeholder='请输入密码'
allowClear
/>
</Form.Item>
<Form.Item
name='remember'
className='login-remember'
valuePropName='checked'
wrapperCol={{ offset: 4, span: 8 }}
>
<Checkbox>记住密码</Checkbox>
</Form.Item>
<Form.Item wrapperCol={{ offset: 7, span: 15 }}>
<Button
type='primary'
htmlType='submit'
shape='round'
size='large'
className='login-submit'
>
登录
</Button>
</Form.Item>
</Form>
</div>
</div>
</div>
</div>
);
}
export default LoginView;
...@@ -13,6 +13,7 @@ import { PointRules } from '~/pages/pointManage/pointRules'; ...@@ -13,6 +13,7 @@ import { PointRules } from '~/pages/pointManage/pointRules';
import PointDetailList from '~/pages/pointManage/pointDetail'; import PointDetailList from '~/pages/pointManage/pointDetail';
import DivideOrder from '~/pages/pointManage/divideOrder'; import DivideOrder from '~/pages/pointManage/divideOrder';
import DivideRules from '~/pages/pointManage/divideRules'; import DivideRules from '~/pages/pointManage/divideRules';
import LoginView from '~/pages/common/login';
const ProductOrderView = React.lazy(() => import('src/pages/orderManage/productOrder')); //销售订单 const ProductOrderView = React.lazy(() => import('src/pages/orderManage/productOrder')); //销售订单
const EquipmentOrderView = React.lazy(() => import('src/pages/orderManage/equipmentOrder')); //设备订单 const EquipmentOrderView = React.lazy(() => import('src/pages/orderManage/equipmentOrder')); //设备订单
...@@ -166,6 +167,15 @@ export const whiteRouterList: Array<RouteObject & RouteObjectType> = [ ...@@ -166,6 +167,15 @@ export const whiteRouterList: Array<RouteObject & RouteObjectType> = [
icon: MacCommandOutlined, icon: MacCommandOutlined,
}, },
}, },
{
path: '/login',
element: withLoadingComponent(<LoginView />),
meta: {
id: 0,
title: '登录',
icon: MacCommandOutlined,
},
},
]; ];
// 整合路由数据 // 整合路由数据
export const routes = [...routerList, ...whiteRouterList]; export const routes = [...routerList, ...whiteRouterList];
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论