This commit is contained in:
Alex-larget
2026-03-24 18:45:32 +08:00
parent dcb7961945
commit f3d74ce94a
68 changed files with 2461 additions and 2535 deletions

View File

@@ -142,6 +142,7 @@ func defaultMpUi() gin.H {
"chaptersPage": gin.H{
"bookTitle": "一场SOUL的创业实验场",
"bookSubtitle": "来自Soul派对房的真实商业故事",
"newBadgeText": "NEW",
},
"homePage": gin.H{
"logoTitle": "卡若创业派对", "logoSubtitle": "来自派对房的真实故事",
@@ -549,12 +550,13 @@ func DBConfigGet(c *gin.Context) {
q := db.Table("system_config")
if key != "" {
q = q.Where("config_key = ?", key)
q = q.Order("updated_at DESC")
}
if err := q.Find(&list).Error; err != nil {
c.JSON(http.StatusOK, gin.H{"success": false, "error": err.Error()})
return
}
if key != "" && len(list) == 1 {
if key != "" && len(list) > 0 {
var val interface{}
_ = json.Unmarshal(list[0].ConfigValue, &val)
c.JSON(http.StatusOK, gin.H{"success": true, "data": val})
@@ -956,6 +958,11 @@ func DBConfigPost(c *gin.Context) {
if body.Key == "article_ranking_weights" || body.Key == "pinned_section_ids" {
cache.InvalidateBookCache()
}
// 目录篇图标/角标变更后,立即使目录缓存失效,避免前台看到旧值
if body.Key == "book_part_icons" || body.Key == "book_part_badges" {
cache.InvalidateBookParts()
InvalidateChaptersByPartCache()
}
c.JSON(http.StatusOK, gin.H{"success": true, "message": "配置保存成功"})
}