From def2db590250c93ae2c17f7646f8b32e4684b1a2 Mon Sep 17 00:00:00 2001 From: liangxu Date: Mon, 27 Apr 2026 20:06:57 +0800 Subject: [PATCH] fix(publish/sohuhao): align manage URL with v4 console and emit article URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The v3 manage URL has been retired and now redirects through a login gate, breaking the post-publish "管理" deeplink and login detection. Switch the binding console URL and the adapter SOHU_MANAGE_URL to the v4 contentManagement endpoints, and synthesize external_article_url for publish (not draft) results from the article id and account uid so the publish list can offer a "查看文章" link without an extra fetch. Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/desktop-client/src/main/account-binder.ts | 2 +- apps/desktop-client/src/main/adapters/sohuhao.ts | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/desktop-client/src/main/account-binder.ts b/apps/desktop-client/src/main/account-binder.ts index dac6255..472d077 100644 --- a/apps/desktop-client/src/main/account-binder.ts +++ b/apps/desktop-client/src/main/account-binder.ts @@ -2839,7 +2839,7 @@ const publishBindingDefinitions: Record { const editUrl = `${SOHU_ORIGIN}/mpfe/v4/contentManagement/news/addarticle?spm=smmp.articlelist.0.0&contentStatus=2&id=${encodeURIComponent(articleId)}`; + const articleUrl = + publishType === "publish" + ? `https://www.sohu.com/a/${encodeURIComponent(articleId)}_${encodeURIComponent(accountId)}` + : null; return { platform: "sohuhao", media_name: mediaName, external_article_id: articleId, external_manage_url: editUrl || SOHU_MANAGE_URL, - external_article_url: null, + external_article_url: articleUrl, publish_type: publishType, }; } @@ -353,7 +358,7 @@ export const sohuhaoAdapter: PublishAdapter = { return { status: "succeeded", summary: publishType === "draft" ? "搜狐号草稿保存成功。" : "搜狐号发布成功。", - payload: buildResultPayload(articleId, account.name, publishType), + payload: buildResultPayload(articleId, account.id, account.name, publishType), }; } catch (error) { return failureResult(error);