feat: 写作体验优化 + 封面图 + AI辅助写作 + 博客分页

写作体验优化:
- 自动保存草稿到 localStorage(debounce 2s,刷新不丢内容)
- 浏览器原生全屏专注写作模式
- Markdown 编辑模式(左右分栏,实时预览)
- 快捷键:Ctrl+S / Ctrl+Enter 保存,ESC 退出全屏

封面图功能:
- PostForm 新增封面图 URL 输入 + 实时预览
- BlogList 文章卡片显示封面缩略图
- PostContent 文章详情页显示封面大图

AI 辅助写作:
- OpenAI 兼容接口,SSE 流式返回
- 8 种预设操作:润色、扩写、精简、续写、纠错、翻译、摘要
- 自定义指令输入,结果可复制/替换/追加

其他:
- 后台文章列表改为一页10篇
- 前台 /blog 页面添加分页功能(一页10篇)
This commit is contained in:
胡旭
2026-06-24 15:22:03 +08:00
parent 18e915bcbb
commit 43e1c2f61d
11 changed files with 821 additions and 62 deletions
+12
View File
@@ -105,6 +105,18 @@ export default function PostContent({
</div>
</header>
{/* Cover image */}
{post.coverImage && (
<div className="max-w-3xl mx-auto mb-14">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
src={post.coverImage}
alt={post.title}
className="w-full rounded-2xl object-cover max-h-[480px]"
/>
</div>
)}
{/* Decorative divider */}
<div className="max-w-2xl mx-auto mb-14">
<div className="flex items-center justify-center gap-3">