67 lines
1.7 KiB
JavaScript
Raw Normal View History

2023-06-17 11:03:01 +08:00
import React, { useEffect, useState } from 'react';
2023-04-22 20:39:27 +08:00
import { getFooterHTML, getSystemName } from '../helpers';
2023-12-05 21:09:48 +08:00
import {Layout} from "@douyinfe/semi-ui";
2023-04-22 20:39:27 +08:00
const Footer = () => {
const systemName = getSystemName();
2023-06-17 11:03:01 +08:00
const [footer, setFooter] = useState(getFooterHTML());
let remainCheckTimes = 5;
const loadFooter = () => {
let footer_html = localStorage.getItem('footer_html');
if (footer_html) {
setFooter(footer_html);
}
};
useEffect(() => {
const timer = setInterval(() => {
if (remainCheckTimes <= 0) {
clearInterval(timer);
return;
}
remainCheckTimes--;
loadFooter();
}, 200);
return () => clearTimeout(timer);
}, []);
2023-04-22 20:39:27 +08:00
return (
2023-12-05 21:09:48 +08:00
<Layout>
<Layout.Content style={{textAlign: 'center'}}>
{footer ? (
<div
className='custom-footer'
dangerouslySetInnerHTML={{ __html: footer }}
></div>
) : (
<div className='custom-footer'>
2023-04-22 20:39:27 +08:00
<a
2023-12-05 21:09:48 +08:00
href='https://github.com/Calcium-Ion/new-api'
target='_blank'
2023-04-22 20:39:27 +08:00
>
2023-12-05 21:09:48 +08:00
New API {process.env.REACT_APP_VERSION}{' '}
2023-04-22 20:39:27 +08:00
</a>
{' '}
2023-10-31 00:03:22 +08:00
<a href='https://github.com/Calcium-Ion' target='_blank'>
Calcium-Ion
2023-04-22 20:39:27 +08:00
</a>{' '}
2023-12-05 21:09:48 +08:00
开发基于{' '}
<a href='https://github.com/songquanpeng/one-api' target='_blank'>
One API v0.5.4
</a>{' '}
本项目根据{' '}
<a href='https://opensource.org/licenses/mit-license.php'>
2023-12-05 21:09:48 +08:00
MIT 许可证
</a>{' '}
授权
2023-04-22 20:39:27 +08:00
</div>
)}
2023-12-05 21:09:48 +08:00
</Layout.Content>
</Layout>
2023-04-22 20:39:27 +08:00
);
};
export default Footer;