feat(desktop-client/wangyihao): harden token capture and draft submit flow

Inject the YiDun guardian client to obtain ursToken without relying on
window.neg, fetch the publish detail (wemediaId/onlineState/...) before
saving drafts so 100002 "参数错误" stops blocking submit, downgrade
markdown tables to paragraph rows like Baijiahao, and surface friendlier
errors for token, draft and publish-click failures.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-30 18:15:20 +08:00
parent 9525c1144d
commit bf25fa1a80
6 changed files with 701 additions and 87 deletions
@@ -0,0 +1,15 @@
import type { DesktopArticleContent } from "@geo/shared-types";
import {
prepareBaijiahaoMarkdown,
renderTablesAsParagraphRows,
} from "../../../../../packages/publisher-platforms/src/baijiahao";
import { normalizeArticleHtml } from "./common";
export function prepareWangyihaoArticleHtml(article: DesktopArticleContent): string {
return renderTablesAsParagraphRows(
normalizeArticleHtml(article, {
prepareMarkdown: prepareBaijiahaoMarkdown,
}),
).trim();
}