From ed1a969e68d83cd5ec2bd677237147c657c22ef9 Mon Sep 17 00:00:00 2001 From: Victor_Jay Date: Wed, 27 May 2026 15:31:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(footer):=20=E9=A1=B5=E8=84=9A=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=AE=A1=E7=90=86=E9=9D=A2=E6=9D=BF=E5=85=A5=E5=8F=A3?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=EF=BC=88moderator+=E5=8F=AF=E8=A7=81?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit chore: 站点名称保持硬编码 MetaLab,后台移除该设置项,恢复 Nav 双拼样式 site.brand 后端逻辑保留,页脚仍可配置 --- internal/common/helper.go | 4 ++++ templates/MetaLab-2026/html/layout/footer.html | 2 +- templates/MetaLab-2026/html/layout/header.html | 2 +- templates/admin/html/layout/base.html | 4 ++-- templates/admin/html/site-settings/index.html | 10 ---------- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/internal/common/helper.go b/internal/common/helper.go index 04ce89c..8f51f24 100644 --- a/internal/common/helper.go +++ b/internal/common/helper.go @@ -22,6 +22,10 @@ func BuildPageData(c *gin.Context, extra gin.H) gin.H { } // 注入站点信息(由 InjectSiteInfo 中间件设置) injectSiteInfo(c, data) + // 注入管理入口权限(moderator 及以上可看到页脚管理面板链接) + if role, exists := c.Get("role"); exists { + data["CanAccessAdmin"] = model.HasMinRole(role.(string), model.RoleModerator) + } return data } diff --git a/templates/MetaLab-2026/html/layout/footer.html b/templates/MetaLab-2026/html/layout/footer.html index 38ae339..3f7c705 100644 --- a/templates/MetaLab-2026/html/layout/footer.html +++ b/templates/MetaLab-2026/html/layout/footer.html @@ -1,5 +1,5 @@ diff --git a/templates/MetaLab-2026/html/layout/header.html b/templates/MetaLab-2026/html/layout/header.html index 5be7973..81fc2d7 100644 --- a/templates/MetaLab-2026/html/layout/header.html +++ b/templates/MetaLab-2026/html/layout/header.html @@ -4,7 +4,7 @@ {{if .CSRFToken}}{{end}} -{{.Title}} - {{.Brand}} +{{.Title}} - MetaLab {{if .ExtraCSS}} diff --git a/templates/admin/html/layout/base.html b/templates/admin/html/layout/base.html index a6d64de..538b24c 100644 --- a/templates/admin/html/layout/base.html +++ b/templates/admin/html/layout/base.html @@ -4,7 +4,7 @@ {{if .CSRFToken}}{{end}} -{{.Title}} - {{.Brand}} 管理面板 +{{.Title}} - MetaLab 管理面板 {{if .ExtraCSS}} @@ -13,7 +13,7 @@
- +
{{.Username}} 返回前台 diff --git a/templates/admin/html/site-settings/index.html b/templates/admin/html/site-settings/index.html index c73065e..9f84a62 100644 --- a/templates/admin/html/site-settings/index.html +++ b/templates/admin/html/site-settings/index.html @@ -8,16 +8,6 @@
基本设置
-
-
- 品牌名称 - 显示在页面标题、页脚、管理面板中 -
-
- - -
-
版权信息