// 保存文章时若前端未提供 tags 或 tags 为空,自动从 SEO 关键词拆前 3 个作为展示标签 // 兼容中/英逗号和顿号。tags 是卡片小标签(展示用),seo_keywords 是搜索引擎 meta 用,二者语义略有差异但在 admin 未提供 tags 输入框前用此兜底 export function resolveTagsWithFallback(body) { if (Array.isArray(body.tags) && body.tags.length) return body.tags const kw = typeof body.seoKeywords === 'string' ? body.seoKeywords.trim() : '' if (!kw) return [] return kw.split(/[,,、]/).map(s => s.trim()).filter(Boolean).slice(0, 3) }