Files
easygoadmin-wiki/EasyGoAdmin_Gin_AntdVue/zh/modules/article.md
T
2026-10-25 17:24:27 +08:00

35 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 6.8 文章管理
:::tip 概述
文章(gin_article,租户级)是内容管理的核心表,承载富文本正文与单图封面——完整示范 ModuleSpec 的**内容字段(ContentFields)与文件字段(FileFields)**组合。
:::
## 功能清单
| 接口 | 说明 |
|---|---|
| Page / List / Detail | 标准查询(分类/状态/关键字过滤) |
| Add / Update | 维护(正文占位符化 + 封面转正) |
| Status | 上下架单列更新 |
| Delete / BatchDelete | 软删除 |
## 特色机制
- **富文本契约**:正文内本站文件统一存 `[IMG_URL]/{相对路径}` 占位符(写侧 ContentFields 处理),读侧经 ExpandContentFields 唯一还原出口补全域名——防止正文里散落不可迁移的绝对 URL
- **封面单图**:FileFields 声明,写侧 temp 转正到文章目录,读侧补访问域名
- **分类关联**:category_id 关联 gin_category,列表读侧回填分类名
- **租户隔离**:写补 tenant_id、读自动过滤
## 内容字段的意义
正文存占位符而非完整 URL,使整库搬迁/换域名时只需改 `file.domainUrl` 配置——富文本资产随配置迁移,这是 [7.3 富文本处理](/zh/tools/rich-text.html) 的设计动机。
## 管理界面
`content/article`:列表 + 富文本编辑器(Editor 组件)+ 封面上传(Upload 组件)。
## 相关
- [7.3 富文本处理](/zh/tools/rich-text.html)
- [6.9 分类管理](/zh/modules/category.html)