feat: 封禁用户 NAV 横幅 + Space 页面隐藏个性签名

- BuildPageData 注入 IsBanned 字段,封禁用户所有页面显示红色横幅
- Space 页面对封禁用户覆写 Bio 为'该账号已被封禁',原文保留
- 新增 banned-banner 样式(浅红底深红字)
This commit is contained in:
2026-05-31 21:27:27 +08:00
parent bbcd992614
commit 209336b429
4 changed files with 19 additions and 1 deletions

View File

@ -110,6 +110,10 @@ func BuildPageData(c *gin.Context, extra gin.H) gin.H {
if isMaintenance, exists := c.Get("is_maintenance"); exists {
data["IsMaintenance"] = isMaintenance
}
// 注入封禁状态
if status, exists := c.Get("status"); exists && status == model.StatusBanned {
data["IsBanned"] = true
}
return data
}

View File

@ -73,3 +73,11 @@
{{end}}
</div>
{{end}}
{{if .IsBanned}}
<div class="maintenance-banner banned-banner">
<span class="maintenance-banner-icon">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>
</span>
<span>该账号已被封禁</span>
</div>
{{end}}

View File

@ -24,7 +24,7 @@
</div>
<div class="space-info">
<h1 class="space-username">{{.SpaceUser.Username}}</h1>
<p class="space-bio">{{if .SpaceUser.Bio}}{{.SpaceUser.Bio}}{{else}}&nbsp;{{end}}</p>
<p class="space-bio">{{if eq .SpaceUser.Status "banned"}}<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:-3px;margin-right:4px"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>该账号已被封禁{{else if .SpaceUser.Bio}}{{.SpaceUser.Bio}}{{else}}&nbsp;{{end}}</p>
<div class="space-meta">
<span class="space-uid">UID: {{.SpaceUser.ID}}</span>
<span class="space-divider">·</span>

View File

@ -386,6 +386,12 @@ header {
margin-right: .4rem;
}
.maintenance-banner.banned-banner {
background: #fde8e8;
border-bottom-color: #f5b7b7;
color: #981b1b;
}
/* ---------- Contact / Footer ---------- */
.contact-bar {
text-align: center;