优化
This commit is contained in:
@@ -92,17 +92,6 @@ func (h *Dictionary) Export(c *gin.Context) {
|
||||
httpx.Fail(c, "导出失败")
|
||||
return
|
||||
}
|
||||
delete(item, "ID")
|
||||
delete(item, "CreatedAt")
|
||||
delete(item, "UpdatedAt")
|
||||
delete(item, "DeletedAt")
|
||||
if details, ok := item["sysDictionaryDetails"].([]map[string]any); ok {
|
||||
for _, detail := range details {
|
||||
for _, key := range []string{"ID", "CreatedAt", "UpdatedAt", "DeletedAt", "sysDictionaryID", "parentID", "disabled", "children"} {
|
||||
delete(detail, key)
|
||||
}
|
||||
}
|
||||
}
|
||||
httpx.Write(c, httpx.CodeSuccess, item, "导出成功")
|
||||
}
|
||||
func (h *Dictionary) Import(c *gin.Context) {
|
||||
@@ -258,5 +247,5 @@ func (h *Dictionary) Path(c *gin.Context) {
|
||||
httpx.Fail(c, "获取失败")
|
||||
return
|
||||
}
|
||||
httpx.Write(c, httpx.CodeSuccess, gin.H{"path": item["path"]}, "获取成功")
|
||||
httpx.Write(c, httpx.CodeSuccess, gin.H{"path": item.Path}, "获取成功")
|
||||
}
|
||||
|
||||
@@ -44,7 +44,12 @@ func (h *SystemConfig) SetSecurity(c *gin.Context) {
|
||||
}
|
||||
|
||||
func (h *SystemConfig) Get(c *gin.Context) {
|
||||
httpx.Write(c, httpx.CodeSuccess, h.system.SystemConfig(), "获取成功")
|
||||
value, err := h.system.SystemConfig()
|
||||
if err != nil {
|
||||
httpx.Fail(c, "获取失败")
|
||||
return
|
||||
}
|
||||
httpx.Write(c, httpx.CodeSuccess, value, "获取成功")
|
||||
}
|
||||
|
||||
func (h *SystemConfig) Set(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user