change footer

dev
Dawn1Ocean 2024-03-31 14:44:30 +08:00
parent 54290fa2fc
commit 2eb06bd720
4 changed files with 20 additions and 25 deletions

View File

@ -1,4 +1,4 @@
import { AvatarDropdown, AvatarName, Footer, Question } from '@/components';
import { AvatarDropdown, AvatarName, PageFooter, Question } from '@/components';
import { currentUser as queryCurrentUser } from '@/services/ant-design-pro/api';
import { LinkOutlined } from '@ant-design/icons';
import type { Settings as LayoutSettings } from '@ant-design/pro-components';
@ -57,10 +57,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
return <AvatarDropdown>{avatarChildren}</AvatarDropdown>;
},
},
waterMarkProps: {
content: initialState?.currentUser?.name,
},
footerRender: () => <Footer />,
footerRender: () => <PageFooter />,
onPageChange: () => {
const { location } = history;
// 如果没有登录,重定向到 login

View File

@ -2,34 +2,32 @@ import { GithubOutlined } from '@ant-design/icons';
import { DefaultFooter } from '@ant-design/pro-components';
import React from 'react';
const Footer: React.FC = () => {
const PageFooter: React.FC = () => {
const startYear = 2024;
const curYear = new Date().getFullYear();
let yearStr = '';
if (startYear === curYear) {
yearStr = curYear.toString();
} else {
yearStr = startYear.toString() + ' - ' + curYear.toString();
}
return (
<DefaultFooter
copyright={yearStr + " EVA Tech"}
style={{
background: 'none',
color: '#808080'
}}
links={[
{
key: 'Ant Design Pro',
title: 'Ant Design Pro',
key: 'EVA Tea',
title: 'EVA Tea',
href: 'https://pro.ant.design',
blankTarget: true,
},
{
key: 'github',
title: <GithubOutlined />,
href: 'https://github.com/ant-design/ant-design-pro',
blankTarget: true,
},
{
key: 'Ant Design',
title: 'Ant Design',
href: 'https://ant.design',
blankTarget: true,
},
]}
/>
);
};
export default Footer;
export default PageFooter;

View File

@ -5,7 +5,7 @@
/**
*
*/
import Footer from './Footer';
import PageFooter from './Footer';
import { Question } from './RightContent';
import { AvatarDropdown, AvatarName } from './RightContent/AvatarDropdown';
export { AvatarDropdown, AvatarName, Footer, Question };
export { AvatarDropdown, AvatarName, PageFooter, Question };

View File

@ -1,4 +1,4 @@
import { Footer } from '@/components';
import { PageFooter } from '@/components';
import { login } from '@/services/ant-design-pro/api';
import { getFakeCaptcha } from '@/services/ant-design-pro/login';
import {
@ -275,7 +275,7 @@ const Login: React.FC = () => {
</div>
</LoginForm>
</div>
<Footer />
<PageFooter />
</div>
);
};