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

问题清单

parent 7dfd0e70
...@@ -26,6 +26,7 @@ export default [ ...@@ -26,6 +26,7 @@ export default [
path: '/welcome', path: '/welcome',
name: 'welcome', name: 'welcome',
icon: 'smile', icon: 'smile',
layout: false,
component: './Welcome', component: './Welcome',
}, },
{ {
......
...@@ -180,6 +180,7 @@ export async function getInitialState(): Promise<{ ...@@ -180,6 +180,7 @@ export async function getInitialState(): Promise<{
settings?: Partial<LayoutSettings>; settings?: Partial<LayoutSettings>;
currentUser?: Api.CurrentUser; currentUser?: Api.CurrentUser;
menuPaths?: any; menuPaths?: any;
menuList?: any;
permissions?: string[]; permissions?: string[];
loading?: boolean; loading?: boolean;
fetchUserInfo?: () => Promise<Api.CurrentUser | undefined>; fetchUserInfo?: () => Promise<Api.CurrentUser | undefined>;
...@@ -237,12 +238,11 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) = ...@@ -237,12 +238,11 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
const result = defaultResult; const result = defaultResult;
extendMenuProp([], defaultMenuData); extendMenuProp([], defaultMenuData);
const menuPaths = extractMenuPath(result); const menuPaths = extractMenuPath(result);
await setInitialState((s) => ({ ...s, menuPaths })); await setInitialState((s) => ({ ...s, menuPaths, menuList: result }));
return result; return result;
} else return []; } else return [];
}, },
}, },
title: localStorage.getItem('umi_locale') === 'th-TH' ? 'ระบบ Kanban' : '看板系统',
rightContentRender: () => <RightContent />, rightContentRender: () => <RightContent />,
disableContentMargin: false, disableContentMargin: false,
footerRender: () => <Footer />, footerRender: () => <Footer />,
...@@ -259,14 +259,6 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) = ...@@ -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, menuHeaderRender: undefined,
// 自定义 403 页面 // 自定义 403 页面
// unAccessible: <div>unAccessible</div>, // unAccessible: <div>unAccessible</div>,
......
...@@ -96,5 +96,6 @@ export default { ...@@ -96,5 +96,6 @@ export default {
'menu.personalSetting': 'ศูนย์ส่วนบุคคล', 'menu.personalSetting': 'ศูนย์ส่วนบุคคล',
'menu.personalSetting.pwd': 'แก้ไขรหัสผ่าน', 'menu.personalSetting.pwd': 'แก้ไขรหัสผ่าน',
'退出登录': 'ออกจาก Login', '退出登录': 'ออกจาก Login',
'希迈看板平台': 'Thai Xi Mai Kanban System',
'个人信息': 'ข้อมูลส่วนบุคคล' '个人信息': 'ข้อมูลส่วนบุคคล'
}; };
...@@ -98,5 +98,6 @@ export default { ...@@ -98,5 +98,6 @@ export default {
'menu.personalSetting': '个人中心', 'menu.personalSetting': '个人中心',
'menu.personalSetting.pwd': '修改密码', 'menu.personalSetting.pwd': '修改密码',
'退出登录': '退出登录', '退出登录': '退出登录',
'希迈看板平台': '希迈看板平台',
'个人信息': '个人信息' '个人信息': '个人信息'
}; };
...@@ -6,3 +6,92 @@ ...@@ -6,3 +6,92 @@
background: @input-bg; background: @input-bg;
box-shadow: @card-shadow; 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 React, { useState,useEffect } from 'react';
import { useIntl } from 'umi'; import { useIntl, useModel } from 'umi';
import { PageContainer } from '@ant-design/pro-layout'; import { useHistory } from 'react-router-dom';
import { Card, Alert } from 'antd'; import styles from './Welcome.less';
import { logout as outLogin } from '@/services/mgr/api';
const Welcome: React.FC = () => { const Welcome: React.FC = () => {
const intl = useIntl(); 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 ( return (
<PageContainer> <div className={styles.container}>
<Card> <div className={styles.logout} onClick={() => loginOut()}>
<Alert {intl.formatMessage({id:'退出登录'})}
message={intl.formatMessage({ </div>
id: 'pages.welcome.speech', <div className={styles.header}>
defaultMessage: '欢迎登陆看板系统', <div className={styles.centerheader}>
})} {intl.formatMessage({id:'希迈看板平台'})}
type="success" </div>
showIcon </div>
banner <div className={styles.content}>
style={{ {kanbanList.map((route) => (
margin: -12, <div key={route.name} className={styles.routeItem} onClick={() => goToPlaylist(route.path)}>
marginBottom: 24, <div className={styles.routeName}>{intl.formatMessage({id: 'menu.kanban.' + route.name})}</div>
}} <div className={styles.imgWapper}>
/> </div>
</Card> </div>
</PageContainer> ))}
</div>
</div>
); );
}; };
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
background: #040f24; background: #040f24;
p { p {
margin-bottom: 0; margin-bottom: 0;
font-size: 20px; font-size: 17px;
} }
h2 { h2 {
margin-bottom: 0; margin-bottom: 0;
...@@ -134,6 +134,7 @@ ...@@ -134,6 +134,7 @@
p { p {
margin-bottom: 15px; margin-bottom: 15px;
font-size: 18px; font-size: 18px;
height: 38px;
} }
h2 { h2 {
display: inline-block; display: inline-block;
......
...@@ -48,7 +48,16 @@ const Login: React.FC = () => { ...@@ -48,7 +48,16 @@ const Login: React.FC = () => {
const handleSubmit = async (values: Api.LoginPubParams) => { const handleSubmit = async (values: Api.LoginPubParams) => {
setSubmitting(true); setSubmitting(true);
try { 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({ const msg = intl.formatMessage({
id: 'pages.login.success', id: 'pages.login.success',
defaultMessage: '登录成功!', 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