1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import React, { useEffect } from 'react';
import { Helmet, HelmetProvider } from 'react-helmet-async';
import { renderRoutes } from 'react-router-config';
import { DefaultFooter, getMenuData, getPageTitle } from '@ant-design/pro-layout';
import logo from '../assets/images/logo/panda-logo.svg';
import styles from './UserLayout.less';
import { BASENAME } from '@/utils/constants';
const UserLayout = props => {
const {
route = {
routes: [],
},
children,
} = props;
// const { formatMessage } = useIntl();
const { breadcrumb } = getMenuData(route.routes);
const title = getPageTitle({
pathname: window.location.pathname,
// formatMessage,
breadcrumb,
...props,
});
// useEffect(() => {
// window.location.href = `/${BASENAME}/user/login`;
// });
return (
<HelmetProvider>
<Helmet>
<title>{title === 'Ant Design Pro' ? '熊猫运维平台' : title}</title>
<meta name="description" content={title} />
</Helmet>
<div className={styles.container}>
<div className={styles.lang}>{/* <SelectLang /> */}</div>
<div className={styles.content}>
<div className={styles.top}>
<div className={styles.header}>
<img alt="logo" className={styles.logo} src={logo} />
<span className={styles.title}>熊猫运维平台</span>
</div>
<div className={styles.desc}>{/* Ant Design 是西湖区最具影响力的 Web 设计规范 */}</div>
</div>
{children || renderRoutes(route.routes)}
</div>
<DefaultFooter copyright={`${new Date().getFullYear()} 熊猫智慧水务有限公司`} links={[]} />
</div>
</HelmetProvider>
);
};
export default UserLayout;