feat: 管理端板块管理与旧版数据导入,补充部署运营文档

- 新增管理端板块管理页面与后端接口(admin_board)
- 新增旧版数据导入:legacyimport 服务、导入面板、importusers 命令行工具
- 聊天用户卡片、板块图标等 UI 组件与界面优化
- 补充 about/公告/1Panel 部署等文档
- gitignore 排除 dist/ 构建产物与 .agents/ 本地工具目录
This commit is contained in:
2026-09-24 03:37:44 +08:00
parent c1f6a6636b
commit 3e55b5d230
53 changed files with 5078 additions and 409 deletions

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"github.com/freefire/jiang13-bbs/middleware"
"github.com/freefire/jiang13-bbs/model"
"github.com/freefire/jiang13-bbs/service"
"github.com/gin-gonic/gin"
"io"
@@ -202,6 +203,10 @@ func (h *Handlers) BusinessQuota(c *gin.Context) {
}
p := c.FullPath()
user := middleware.CurrentUser(c)
if user != nil && model.IsStaff(model.Role(user.Role)) {
c.Next() // 管理角色不受发帖/评论间隔与搜索频控限制
return
}
identity := "ip:" + c.ClientIP()
if user != nil {
identity = "user:" + strconv.Itoa(int(user.ID))
@@ -272,7 +277,13 @@ func (h *Handlers) ResetPassword(c *gin.Context) {
return
}
if e := h.Ops.ResetPassword(req.Email, req.Code, req.Password); e != nil {
c.JSON(400, gin.H{"error": "验证码无效、已过期或密码格式不符合要求"})
var te *service.CodeThrottleError
if errors.As(e, &te) {
c.Header("Retry-After", strconv.Itoa(te.Wait))
c.JSON(429, gin.H{"error": te.Error(), "retry_after": te.Wait})
} else {
c.JSON(400, gin.H{"error": "验证码无效、已过期或密码格式不符合要求"})
}
return
}
c.JSON(200, gin.H{"message": "密码已更新,请重新登录"})