diff --git a/src/pages/article-editor/index.tsx b/src/pages/article-editor/index.tsx index ea9486a..b9b0f0f 100644 --- a/src/pages/article-editor/index.tsx +++ b/src/pages/article-editor/index.tsx @@ -44,6 +44,8 @@ export default function ArticleEditor() { const [cover, setCover] = React.useState(""); const [video, setVideo] = React.useState(""); const [link, setLink] = React.useState(""); + const [cardMode, setCardMode] = React.useState("small"); + const [isPublic, setIsPublic] = React.useState(true); const [html, setHtml] = React.useState(""); const [editor, setEditor] = React.useState(null); const [busy, setBusy] = React.useState(false); @@ -63,6 +65,7 @@ export default function ArticleEditor() { contentApi.getOne(id).then((r) => { setCat(r.type || "policy"); setTitle(r.title || ""); setAuthor(r.publisher_name || ""); setCover(r.cover || ""); setVideo(r.video || ""); setLink(r.link || ""); setHtml(r.body || ""); + setCardMode(r.card_mode || "small"); setIsPublic(r.is_public !== false); }).catch((e) => setErr((e as Error).message || "加载失败")); return () => { if (editor) editor.destroy(); }; }, [id]); @@ -79,6 +82,7 @@ export default function ArticleEditor() { type: cat, title, body: html, cover, video, link, publisher_name: author, + card_mode: cardMode, is_public: isPublic, status, summary: stripHtml(html).slice(0, 80), }; @@ -138,6 +142,17 @@ export default function ArticleEditor() { {CATS.map((c) => {c.label})} + + setVideo(e.target.value)} /> setLink(e.target.value)} /> @@ -175,7 +190,7 @@ export default function ArticleEditor() {
{author || "云超服"}
{video &&
} - {link && 原文链接 ↗} + {link && 原文链接}