From 04cdb98c5e59fcca8ad90c5a4551d13fb9be3b86 Mon Sep 17 00:00:00 2001 From: skyle1995 Date: Wed, 1 Apr 2026 04:30:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=93=8D=E4=BD=9C=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=8F=92=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/admin/settings.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/controllers/admin/settings.go b/controllers/admin/settings.go index 6253871..9e4faf1 100644 --- a/controllers/admin/settings.go +++ b/controllers/admin/settings.go @@ -160,10 +160,24 @@ func SettingsUpdateHandler(c *gin.Context) { operator = "system" } + // 解析详细的子分类日志名称 + categoryNameMap := map[string]string{ + "basic": "基本信息", + "security": "系统和安全", + "log": "日志清理", + "cookie": "Cookie 设置", + "footer": "页脚与备案", + "style": "模板样式", + } + // 记录操作日志 logType := "系统设置" if categoryStr != "" { - logType = fmt.Sprintf("系统设置-%s", categoryStr) + if mappedName, exists := categoryNameMap[categoryStr]; exists { + logType = fmt.Sprintf("系统设置-%s", mappedName) + } else { + logType = fmt.Sprintf("系统设置-%s", categoryStr) + } } services.RecordOperationLog(logType, operator, operatorUUID, fmt.Sprintf("管理员更新了系统设置,包含 %d 个配置项", len(settingsData)))