Update App.jsx via upload script - 2026-11-10 17:59:01
This commit is contained in:
parent
d9acf1f049
commit
292b17f907
6
App.jsx
6
App.jsx
|
|
@ -7209,9 +7209,9 @@ function SiteNewsEditor({ news, setNews, onNotify }) {
|
||||||
const r = await fetch('/api/site/news/import', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ url: u }) });
|
const r = await fetch('/api/site/news/import', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ url: u }) });
|
||||||
const j = await r.json().catch(() => ({}));
|
const j = await r.json().catch(() => ({}));
|
||||||
if (!r.ok) throw new Error(j.error || `导入失败(${r.status})`);
|
if (!r.ok) throw new Error(j.error || `导入失败(${r.status})`);
|
||||||
setNews(l => [j.draft, ...l]);
|
setNews(l => [{ ...j.draft, published: true }, ...l]);
|
||||||
setOpenId(j.draft.id); setUrl('');
|
setOpenId(j.draft.id); setUrl('');
|
||||||
setMsg({ text: `✓ 已导入:${j.stats.blocks} 个内容块、${j.stats.images} 张图片${j.stats.failed ? `(${j.stats.failed} 张下载失败,已跳过)` : ''}。检查排版、日期和分类后,打开"在网站上显示"。` });
|
setMsg({ text: `✓ 已导入:${j.stats.blocks} 个内容块、${j.stats.images} 张图片${j.stats.failed ? `(${j.stats.failed} 张下载失败,已跳过)` : ''}。已设为在网站上显示,约 3 分钟后网站自动更新;需要改排版、日期或分类的现在改即可。` });
|
||||||
} catch (e) { setMsg({ err: true, text: e.message }); }
|
} catch (e) { setMsg({ err: true, text: e.message }); }
|
||||||
setBusy(false);
|
setBusy(false);
|
||||||
}
|
}
|
||||||
|
|
@ -7228,7 +7228,7 @@ function SiteNewsEditor({ news, setNews, onNotify }) {
|
||||||
<input className="input" style={{ flex: '1 1 320px' }} value={url} disabled={busy} onChange={e => setUrl(e.target.value)} onKeyDown={e => { if (e.key === 'Enter') doImport(); }} placeholder="粘贴文章链接,如 https://mp.weixin.qq.com/s/Vq2j2V0UB2o4WtAbUFqyTA" />
|
<input className="input" style={{ flex: '1 1 320px' }} value={url} disabled={busy} onChange={e => setUrl(e.target.value)} onKeyDown={e => { if (e.key === 'Enter') doImport(); }} placeholder="粘贴文章链接,如 https://mp.weixin.qq.com/s/Vq2j2V0UB2o4WtAbUFqyTA" />
|
||||||
<button type="button" className="btn btn-primary btn-sm" disabled={busy || !url.trim()} onClick={doImport}><Download size={12} />{busy ? '导入中…' : '导入'}</button>
|
<button type="button" className="btn btn-primary btn-sm" disabled={busy || !url.trim()} onClick={doImport}><Download size={12} />{busy ? '导入中…' : '导入'}</button>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ fontSize: 12, color: 'var(--ink-soft)' }}>自动收录标题、发布时间、正文文字和图片(图片保存到服务器,网站不依赖微信)。导入后是草稿,不会马上出现在网站上。微信里的视频不能搬运,可以上传到 YouTube 后把链接填进视频块。</div>
|
<div style={{ fontSize: 12, color: 'var(--ink-soft)' }}>自动收录标题、发布时间、正文文字和图片(图片保存到服务器,网站不依赖微信)。导入后默认在网站上显示(约 3 分钟后网站自动更新);不想发布的取消勾选「在网站上显示」即可。微信里的视频不能搬运,可以上传到 YouTube 后把链接填进视频块。</div>
|
||||||
{msg && <div style={{ fontSize: 12.5, color: msg.err ? '#b42318' : 'var(--ink)' }}>{msg.text}</div>}
|
{msg && <div style={{ fontSize: 12.5, color: msg.err ? '#b42318' : 'var(--ink)' }}>{msg.text}</div>}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ display: 'flex', gap: 8, flexWrap: 'wrap' }}>
|
<div style={{ display: 'flex', gap: 8, flexWrap: 'wrap' }}>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue