53ab7fd778
- 创建 useSiteSettings composable 在应用启动时加载系统设置 - 从 window.__SITE_CONFIG__(后端注入)和 localStorage 初始化设置 - 修复 favicon 更新逻辑,正确移除旧 favicon 并添加新的 - 在路由守卫中设置页面标题,格式为 '页面名 - 网站名' - 简化 admin.vue 和 admin-sidebar 组件,使用统一的设置管理 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
43 lines
1.5 KiB
HTML
43 lines
1.5 KiB
HTML
<!doctype html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<link rel="icon" type="image/svg+xml" media="(prefers-color-scheme: dark)" href="/logo.svg" />
|
|
<link rel="icon" type="image/svg+xml" media="(prefers-color-scheme: light)" href="/logo-black.svg" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>加载中...</title>
|
|
|
|
<!-- Google Fonts - Inter -->
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
|
|
<!-- 后端注入的系统配置(生产环境由后端渲染) -->
|
|
<script>
|
|
// 后端渲染时会注入这些变量,开发环境使用默认值
|
|
window.__SITE_CONFIG__ = {
|
|
siteName: '{{.SiteName}}',
|
|
siteDescription: '{{.SiteDescription}}',
|
|
logoLight: '{{.LogoLight}}',
|
|
logoDark: '{{.LogoDark}}',
|
|
favicon: '{{.Favicon}}',
|
|
};
|
|
|
|
// 检测是否是开发环境(模板变量未被替换)
|
|
if (window.__SITE_CONFIG__.siteName.indexOf('{{') === 0) {
|
|
window.__SITE_CONFIG__ = {
|
|
siteName: '',
|
|
siteDescription: '',
|
|
logoLight: '',
|
|
logoDark: '',
|
|
favicon: '',
|
|
};
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="app"></div>
|
|
<script type="module" src="/src/main.ts"></script>
|
|
</body>
|
|
</html>
|