mirror of
https://github.com/skyle1995/NetworkAuth.git
synced 2026-05-25 02:24:05 +08:00
优化操作日志插入
This commit is contained in:
@@ -160,11 +160,25 @@ func SettingsUpdateHandler(c *gin.Context) {
|
|||||||
operator = "system"
|
operator = "system"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 解析详细的子分类日志名称
|
||||||
|
categoryNameMap := map[string]string{
|
||||||
|
"basic": "基本信息",
|
||||||
|
"security": "系统和安全",
|
||||||
|
"log": "日志清理",
|
||||||
|
"cookie": "Cookie 设置",
|
||||||
|
"footer": "页脚与备案",
|
||||||
|
"style": "模板样式",
|
||||||
|
}
|
||||||
|
|
||||||
// 记录操作日志
|
// 记录操作日志
|
||||||
logType := "系统设置"
|
logType := "系统设置"
|
||||||
if categoryStr != "" {
|
if categoryStr != "" {
|
||||||
|
if mappedName, exists := categoryNameMap[categoryStr]; exists {
|
||||||
|
logType = fmt.Sprintf("系统设置-%s", mappedName)
|
||||||
|
} else {
|
||||||
logType = fmt.Sprintf("系统设置-%s", categoryStr)
|
logType = fmt.Sprintf("系统设置-%s", categoryStr)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
services.RecordOperationLog(logType, operator, operatorUUID, fmt.Sprintf("管理员更新了系统设置,包含 %d 个配置项", len(settingsData)))
|
services.RecordOperationLog(logType, operator, operatorUUID, fmt.Sprintf("管理员更新了系统设置,包含 %d 个配置项", len(settingsData)))
|
||||||
|
|
||||||
authBaseController.HandleSuccess(c, "保存成功", nil)
|
authBaseController.HandleSuccess(c, "保存成功", nil)
|
||||||
|
|||||||
Reference in New Issue
Block a user