同步
This commit is contained in:
@@ -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": "配置保存成功"})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user