From 0a597cfa42fd1c582a31e24decf200cf40dc96b7 Mon Sep 17 00:00:00 2001 From: Aska Date: Mon, 7 Sep 2026 20:29:56 +0800 Subject: [PATCH] =?UTF-8?q?feat(weixin):=20=E5=BE=AE=E4=BF=A1iLink?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E9=85=8D=E7=BD=AE/=E5=90=AF=E7=94=A8?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=AF=B9=E9=BD=90=E7=9C=9F=E5=AE=9E=E6=A1=A5?= =?UTF-8?q?=E6=8E=A5(token=E5=8D=B3=E7=94=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 面板此前让用户手填 bot_id/owner_id/cursor(实为扫码登录后自动获取/自动落盘),与参考 weixin_ClawBot_Bridge 流程不符。对齐成 kook/telegram 的'token即用、其余自动获取': - channelFields.ts: weixin-ilink 字段只留 cdn_base_url(可选,留空自动),移除 bot_id/owner_id/ cursor; guide/hint 改为'只需填 bot_token(必填,或连接时触发扫码登录自动获取),其余自动获取' - AdapterDetailPage/GenericAdapterPanel: 账号身份区显示自动获取的 bot_id(account.botId) - 后端确认无需改: cmd/cyrene 仅校验 bot_token;Connect(BotToken空)自动扫码并持久化 bot_token/ bot_id/owner_id;游标自动落盘;与参考一致 验收: 前端 build 100模块绿 + 后端相关包 build/test ok(无Go改动) --- frontend/web/src/admin/modules/channelFields.ts | 9 +++------ .../web/src/admin/modules/channels/AdapterDetailPage.tsx | 1 + .../src/admin/modules/channels/GenericAdapterPanel.tsx | 1 + 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/frontend/web/src/admin/modules/channelFields.ts b/frontend/web/src/admin/modules/channelFields.ts index 696ff55..22e0985 100644 --- a/frontend/web/src/admin/modules/channelFields.ts +++ b/frontend/web/src/admin/modules/channelFields.ts @@ -24,10 +24,7 @@ export const PLATFORM_FIELDS: Record = { ], telegram: [{ key: "webhook_url", label: "webhook_url(公网回调地址)", placeholder: "https://…" }], "weixin-ilink": [ - { key: "cdn_base_url", label: "cdn_base_url(媒体 CDN)", placeholder: "https://…" }, - { key: "bot_id", label: "bot_id(ilink_bot_id)", placeholder: "wx…" }, - { key: "owner_id", label: "owner_id(绑定主人 uid)", placeholder: "wx…" }, - { key: "cursor", label: "cursor(get_updates_buf)", placeholder: "…" }, + { key: "cdn_base_url", label: "cdn_base_url(媒体 CDN,留空自动)", placeholder: "https://…" }, ], webhook: [ { key: "endpointPath", label: "endpointPath(挂载路由)", placeholder: "/webhook" }, @@ -59,8 +56,8 @@ export const PLATFORM_GUIDE: Record = { hint: "webhook_url(公网回调,可选)在「高级选项」里配置;留空则走长轮询。", }, "weixin-ilink": { - guide: "填 bot_token(必填)与 bot_id / owner_id", - hint: "bot_id / owner_id / cdn_base_url / cursor 在「高级选项」里配置;媒体 CDN 可留空自动。", + guide: "只需填 bot_token(必填,或连接时触发扫码登录自动获取),其余自动获取", + hint: "连接后自动获取 bot 身份(ilink_bot_id / bot_id)并持续维护 get_updates_buf 游标;需要媒体 CDN 时可在「高级选项」配 cdn_base_url(留空自动)。", }, webhook: { guide: "填 endpointPath 与 secret(必填)", diff --git a/frontend/web/src/admin/modules/channels/AdapterDetailPage.tsx b/frontend/web/src/admin/modules/channels/AdapterDetailPage.tsx index 571fb60..edc99ff 100644 --- a/frontend/web/src/admin/modules/channels/AdapterDetailPage.tsx +++ b/frontend/web/src/admin/modules/channels/AdapterDetailPage.tsx @@ -55,6 +55,7 @@ export function AdapterDetailPage({ adapter, onBack }: { adapter: string; onBack {connected ? "已连接" : "未连接"} {account?.botUsername ? @{account.botUsername} : null} {account?.botNickname ? {account.botNickname} : null} + {account?.botId ? bot_id:{account.botId} : null} {loading ? 加载中… : null}
diff --git a/frontend/web/src/admin/modules/channels/GenericAdapterPanel.tsx b/frontend/web/src/admin/modules/channels/GenericAdapterPanel.tsx index 067b9b4..e5ab92b 100644 --- a/frontend/web/src/admin/modules/channels/GenericAdapterPanel.tsx +++ b/frontend/web/src/admin/modules/channels/GenericAdapterPanel.tsx @@ -35,6 +35,7 @@ export function GenericAdapterPanel({
{label} 平台能力 {accountName} + {account?.botId ? bot_id:{account.botId} : null} 通用壳 · 平台专属端点未接入