feat: 实现完整的板块级RBAC内容审核系统

- 新增站长/超级管理员/管理员/板块管理员四级角色体系
- 实现实时权限快照加载与细粒度权限校验
- 新增内容审核队列与前后端页面
- 重构用户权限管理与站点管理逻辑
- 新增评论/帖子审核状态与通知推送
- 优化前端权限控制与角色徽章展示
- 修正数据库迁移与默认值问题
This commit is contained in:
2026-09-15 04:47:34 +08:00
parent 6da4309453
commit a7b6421840
44 changed files with 3149 additions and 585 deletions

View File

@@ -5,6 +5,7 @@ import (
"strconv"
"github.com/freefire/jiang13-bbs/middleware"
"github.com/freefire/jiang13-bbs/model"
"github.com/gin-gonic/gin"
)
@@ -88,6 +89,12 @@ func (h *Handlers) UserProfile(c *gin.Context) {
streak = cs.Streak
}
// 板块管理员公开其授权板块(角色徽章展示"板块管理员 · 板块名")
var boardIDs []uint
if user.Role == model.RoleBoardAdmin {
boardIDs, _ = h.Auth.GetUserBoardIDs(user.ID)
}
c.JSON(http.StatusOK, gin.H{
"user": gin.H{
"id": user.ID,
@@ -96,6 +103,7 @@ func (h *Handlers) UserProfile(c *gin.Context) {
"avatar": user.Avatar,
"signature": user.Signature,
"role": user.Role,
"board_ids": boardIDs,
"created_at": user.CreatedAt,
},
"stats": gin.H{