feat(admin): 富文本与内容管理页调整;链接标签模型与 db 同步;更新 dist

Made-with: Cursor
This commit is contained in:
卡若
2026-03-24 12:29:46 +08:00
parent 70b83fdb25
commit f069b71374
8 changed files with 272 additions and 153 deletions

View File

@@ -317,9 +317,18 @@ func buildMiniprogramConfig() gin.H {
_ = db.Order("label ASC").Find(&linkTagRows).Error
tags := make([]gin.H, 0, len(linkTagRows))
for _, t := range linkTagRows {
h := gin.H{"tagId": t.TagID, "label": t.Label, "url": t.URL, "type": t.Type, "pagePath": t.PagePath}
cType := t.Type
cURL := t.URL
// wxlink小程序短链下发给 C 端时转为 url 类型,现有 read.js web-view 可直接跳转,无需升级小程序
if strings.EqualFold(cType, "wxlink") {
cType = "url"
if cURL == "" {
cURL = t.AppID
}
}
h := gin.H{"tagId": t.TagID, "label": t.Label, "url": cURL, "type": cType, "pagePath": t.PagePath}
if t.Type == "miniprogram" {
h["mpKey"] = t.AppID // 可为「关联表 key」或「直接 wx AppID」后者由 mergeDirectMiniProgramLinksFromLinkTags 补全 linkedMiniprograms
h["mpKey"] = t.AppID
} else {
h["appId"] = t.AppID
}