Commit f34a3ca6 authored by 沈翠玲's avatar 沈翠玲

问题清单

parent 7dfd0e70
......@@ -26,6 +26,7 @@ export default [
path: '/welcome',
name: 'welcome',
icon: 'smile',
layout: false,
component: './Welcome',
},
{
......
......@@ -180,6 +180,7 @@ export async function getInitialState(): Promise<{
settings?: Partial<LayoutSettings>;
currentUser?: Api.CurrentUser;
menuPaths?: any;
menuList?: any;
permissions?: string[];
loading?: boolean;
fetchUserInfo?: () => Promise<Api.CurrentUser | undefined>;
......@@ -237,12 +238,11 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
const result = defaultResult;
extendMenuProp([], defaultMenuData);
const menuPaths = extractMenuPath(result);
await setInitialState((s) => ({ ...s, menuPaths }));
await setInitialState((s) => ({ ...s, menuPaths, menuList: result }));
return result;
} else return [];
},
},
title: localStorage.getItem('umi_locale') === 'th-TH' ? 'ระบบ Kanban' : '看板系统',
rightContentRender: () => <RightContent />,
disableContentMargin: false,
footerRender: () => <Footer />,
......@@ -259,14 +259,6 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
// }
// }
},
links: isDev
? [
<Link key="openapi" to="/api/doc.html" target="_blank">
<LinkOutlined />
<span>API文档</span>
</Link>,
]
: [],
menuHeaderRender: undefined,
// 自定义 403 页面
// unAccessible: <div>unAccessible</div>,
......
......@@ -96,5 +96,6 @@ export default {
'menu.personalSetting': 'ศูนย์ส่วนบุคคล',
'menu.personalSetting.pwd': 'แก้ไขรหัสผ่าน',
'退出登录': 'ออกจาก Login',
'希迈看板平台': 'Thai Xi Mai Kanban System',
'个人信息': 'ข้อมูลส่วนบุคคล'
};
......@@ -98,5 +98,6 @@ export default {
'menu.personalSetting': '个人中心',
'menu.personalSetting.pwd': '修改密码',
'退出登录': '退出登录',
'希迈看板平台': '希迈看板平台',
'个人信息': '个人信息'
};
......@@ -6,3 +6,92 @@
background: @input-bg;
box-shadow: @card-shadow;
}
.container {
width: 100%;
display: flex;
color: #fff;
position: relative;
flex-direction: column;
transform-origin: top left;
align-items: center;
height: 100%;
color: white;
background: #00204c;
}
.header {
height: 110px;
position: relative;
padding: 0 0 0 0;
}
.centerheader {
margin: 0 300px 0 300px;
padding: 10px 0 0 0;
font-weight: 550;
font-size: 60px;
letter-spacing: 10px;
text-align: center;
text-shadow: 0 0 6px #9fc4f5, 0 0 6px #9fc4f5;
}
.content {
width: 100%;
padding: 50px 100px 0 100px;
display: flex;
flex-direction: row;
}
.routeItem {
position: relative;
transition: transform 0.3s ease, box-shadow 0.3s ease;
cursor: pointer;
border-radius: 10px;
overflow: hidden;
background-color: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.3);
backdrop-filter: blur(5px);
&:hover {
transform: scale(1.1);
box-shadow: 0 0 20px #104da1;
}
&:nth-child(1) {
.imgWapper {
background-image: url('./img/1.png');
}
}
}
.logout {
position: absolute;
top: 30px;
right: 30px;
border: none;
color: white;
padding: 11px 15px;
text-align: center;
text-decoration: none;
display: inline-block;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
font-size: 20px;
background-color: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.3);
&:hover {
background-color: rgb(8, 58, 108);
}
}
.routeName {
font-size: 22px;
line-height: 43px;
text-align: center
}
.imgWapper {
width: 330px;
height: 187px;
background-repeat: no-repeat;
background-position: center;
background-size: cover;
// background: #9fc4f5;
}
\ No newline at end of file
import React from 'react';
import { useIntl } from 'umi';
import { PageContainer } from '@ant-design/pro-layout';
import { Card, Alert } from 'antd';
import React, { useState,useEffect } from 'react';
import { useIntl, useModel } from 'umi';
import { useHistory } from 'react-router-dom';
import styles from './Welcome.less';
import { logout as outLogin } from '@/services/mgr/api';
const Welcome: React.FC = () => {
const intl = useIntl();
const { initialState, setInitialState } = useModel('@@initialState');
const [kanbanList, setkanbanList] = useState([]);
useEffect(() => {
if (initialState?.menuList) {
console.log('sada', initialState?.menuList)
const menuList = initialState?.menuList
const item = menuList.find(v => v.name === 'kanban')
if (item?.children) {
setkanbanList(item?.children)
}
}
}, []);
const history = useHistory();
// 跳转函数
const goToPlaylist = (link: string) => {
history.push(link);
};
/**
* 退出登录,并且将当前的 url 保存
*/
const loginOut = async () => {
setInitialState((s) => ({ ...s, currentUser: undefined }));
await outLogin();
history.replace({ pathname: '/user/login' });
};
return (
<PageContainer>
<Card>
<Alert
message={intl.formatMessage({
id: 'pages.welcome.speech',
defaultMessage: '欢迎登陆看板系统',
})}
type="success"
showIcon
banner
style={{
margin: -12,
marginBottom: 24,
}}
/>
</Card>
</PageContainer>
<div className={styles.container}>
<div className={styles.logout} onClick={() => loginOut()}>
{intl.formatMessage({id:'退出登录'})}
</div>
<div className={styles.header}>
<div className={styles.centerheader}>
{intl.formatMessage({id:'希迈看板平台'})}
</div>
</div>
<div className={styles.content}>
{kanbanList.map((route) => (
<div key={route.name} className={styles.routeItem} onClick={() => goToPlaylist(route.path)}>
<div className={styles.routeName}>{intl.formatMessage({id: 'menu.kanban.' + route.name})}</div>
<div className={styles.imgWapper}>
</div>
</div>
))}
</div>
</div>
);
};
......
......@@ -52,7 +52,7 @@
background: #040f24;
p {
margin-bottom: 0;
font-size: 20px;
font-size: 17px;
}
h2 {
margin-bottom: 0;
......@@ -134,6 +134,7 @@
p {
margin-bottom: 15px;
font-size: 18px;
height: 38px;
}
h2 {
display: inline-block;
......
......@@ -48,7 +48,16 @@ const Login: React.FC = () => {
const handleSubmit = async (values: Api.LoginPubParams) => {
setSubmitting(true);
try {
await login({ ...values });
const res = await login({ ...values });
if (res.code !== 200) {
const msg1 = intl.formatMessage({
id: 'pages.login.failure',
defaultMessage: '登录失败,请重试!',
});
setLoginResult({ message: res.msg || msg1 });
setSubmitting(false);
return
}
const msg = intl.formatMessage({
id: 'pages.login.success',
defaultMessage: '登录成功!',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment