修复新闻工作台换号联动流程

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
LongtailandCopilot committed 2026-11-01 15:11:41 +08:00
1 parent 7ab0bc3485
commit fd9474d0e1
15 files changed
+203 -34

No files matched your search

+3 -3
View File
@@ -439,7 +439,7 @@
if (switcher) switcher.checked = Number(win.wysiwyg) === 0;
}
async function importPrepared(options = {}) {
const { signal, automatic = false } = options;
const { signal, automatic = false, verifyImages = true } = options;
signal?.throwIfAborted();
if (busy) throw new Error('正在导入,请勿重复点击。');
if (!article) throw new Error('请先选择文章目录或文章包。');
@@ -492,10 +492,10 @@
signal?.throwIfAborted();
setEditor(selected.title, bbcode);
const raw = win.getEditorContents();
if (Number(win.wysiwyg) === 1) {
if (Number(win.wysiwyg) === 1 && verifyImages) {
const expected = Array.from(bbcode.matchAll(/\[attachimg\](\d+)\[\/attachimg\]/g), match => match[1]);
await verifyEditorImages(doc.querySelector('#e_iframe')?.contentDocument?.body || win.editdoc?.body, expected, signal);
} else if (raw !== bbcode) throw new Error('正文填写校验失败。');
} else if (Number(win.wysiwyg) !== 1 && raw !== bbcode) throw new Error('正文填写校验失败。');
if (doc.querySelector('#subject').value !== selected.title) throw new Error('标题填写校验失败。');
committed = true;
} catch (error) {