| | |
| | | import { errorConfig } from './requestErrorConfig'; |
| | | const loginPath = '/login'; |
| | | import '../public/font.css' |
| | | import { useEffect, useState } from 'react'; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | // ProLayout 支持的api https://procomponents.ant.design/components/layout |
| | | export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) => { |
| | | const [title, setTitle] = useState(''); |
| | | |
| | | useEffect(() => { |
| | | const updateTitle = () => { |
| | | const now = new Date(); |
| | | const days = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']; |
| | | const formattedDate = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()} ${now.getHours()}:${now.getMinutes()} ${days[now.getDay()]}`; |
| | | setTitle(formattedDate); |
| | | }; |
| | | updateTitle(); |
| | | const interval = setInterval(updateTitle, 1000); // 每分钟更新一次 |
| | | return () => clearInterval(interval); // 清除定时器 |
| | | }, []); |
| | | return { |
| | | title, |
| | | logo: false, |
| | | avatarProps: { |
| | | title: <AvatarName />, |