feat(M5): 前端完善 + 部署 — Vue3 全量页面、仪表盘统计与我的审计接口、systemd/sudoers/迁移脚本、部署文档
This commit is contained in:
@@ -83,3 +83,20 @@ func (h *AuditHandler) Export(c *gin.Context) {
|
||||
// 失败由审计归档兜底),正常路径写入 CSV。
|
||||
_ = h.svc.ExportCSV(c.Request.Context(), c.Writer, since, until)
|
||||
}
|
||||
|
||||
// MyAudit GET /me/audit —— 外部用户查看与自己相关的审计痕迹(PLAN §8 个人中心)。
|
||||
func (h *AuditHandler) MyAudit(c *gin.Context) {
|
||||
page, _ := strconv.Atoi(c.DefaultQuery("page", "1"))
|
||||
pageSize, _ := strconv.Atoi(c.DefaultQuery("page_size", "20"))
|
||||
sess := sessionFrom(c)
|
||||
if sess == nil {
|
||||
fail(c, http.StatusUnauthorized, "未登录")
|
||||
return
|
||||
}
|
||||
rows, total, err := h.svc.QueryByUser(c.Request.Context(), sess.RefID, page, pageSize)
|
||||
if err != nil {
|
||||
fail(c, http.StatusInternalServerError, err.Error())
|
||||
return
|
||||
}
|
||||
ok(c, gin.H{"total": total, "items": rows})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user