feat(布局): 添加应用配置常量并更新主布局标题显示

将网站标题配置提取到单独的配置文件
根据折叠状态动态调整标题字体大小
This commit is contained in:
2025-08-29 00:01:56 +08:00
parent f05eb0aeab
commit af68d94efa
2 changed files with 23 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import { clearToken, getUser as getUserLocal, setUser as setUserLocal } from '..
import api from '../utils/axios'
import './layout.css'
import { PermissionProvider } from '../utils/permission'
import { APP_CONFIG } from '../utils/config'
const { Header, Sider, Content } = Layout
interface MenuItemResp { id: number; parent_id?: number | null; name: string; path?: string | null; component?: string | null; type: number; icon?: string | null; order_no: number; visible: boolean; status: number; perms?: string | null; keep_alive?: boolean }
@ -457,11 +458,20 @@ export default function MainLayout() {
style={{ background: colorBgContainer }}
>
<div
style={{ height: 64, display: 'flex', alignItems: 'center', justifyContent: 'center', fontWeight: 600, cursor: 'pointer', userSelect: 'none' }}
style={{
height: 64,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontWeight: 600,
fontSize: leftCollapsed ? '16px' : '18px',
cursor: 'pointer',
userSelect: 'none'
}}
onClick={() => setLeftCollapsed(c => !c)}
title={leftCollapsed ? '展开菜单' : '收起菜单'}
>
{leftCollapsed ? '道友' : '道友管理系统'}
{leftCollapsed ? APP_CONFIG.SITE_NAME_SHORT : APP_CONFIG.SITE_NAME}
</div>
<Menu
mode="inline"