From 2ea7c72fc63fa882edcca2882175029a38230ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E5=8C=97=E5=B0=98?= <2678115663@qq.com> Date: Fri, 20 Mar 2026 21:13:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20HTTP=20API=20?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=20Type=2049=20=E9=93=BE=E6=8E=A5=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为 HTTP API 导出重新解析 appmsg 子类型,修复公众号链接被误判为 OTHER 的问题,并补齐导出内容中的 `[链接]` 前缀。 Fixes #300 --- electron/services/httpService.ts | 91 +++++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/electron/services/httpService.ts b/electron/services/httpService.ts index 7b95996..163106c 100644 --- a/electron/services/httpService.ts +++ b/electron/services/httpService.ts @@ -1226,7 +1226,7 @@ class HttpService { * 映射 Type 49 子类型 */ private mapType49(msg: Message): number { - const xmlType = msg.xmlType + const xmlType = this.resolveType49Subtype(msg) switch (xmlType) { case '5': // 链接 @@ -1250,10 +1250,97 @@ class HttpService { } } + private extractType49Subtype(rawContent: string): string { + const content = String(rawContent || '') + if (!content) return '' + + const appmsgMatch = /([\s\S]*?)<\/appmsg>/i.exec(content) + if (appmsgMatch) { + const appmsgInner = appmsgMatch[1] + .replace(//gi, '') + .replace(//gi, '') + const typeMatch = /([\s\S]*?)<\/type>/i.exec(appmsgInner) + if (typeMatch) { + return typeMatch[1].replace(//g, '').trim() + } + } + + const fallbackMatch = /([\s\S]*?)<\/type>/i.exec(content) + if (fallbackMatch) { + return fallbackMatch[1].replace(//g, '').trim() + } + + return '' + } + + private resolveType49Subtype(msg: Message): string { + const xmlType = String(msg.xmlType || '').trim() + if (xmlType) return xmlType + + const extractedType = this.extractType49Subtype(msg.rawContent) + if (extractedType) return extractedType + + switch (msg.appMsgKind) { + case 'official-link': + case 'link': + return '5' + case 'file': + return '6' + case 'chat-record': + return '19' + case 'miniapp': + return '33' + case 'quote': + return '57' + case 'transfer': + return '2000' + case 'red-packet': + return '2001' + case 'music': + return '3' + default: + if (msg.linkUrl) return '5' + if (msg.fileName) return '6' + return '' + } + } + + private getType49Content(msg: Message): string { + const subtype = this.resolveType49Subtype(msg) + const title = msg.linkTitle || msg.fileName || '' + + switch (subtype) { + case '5': + case '49': + return title ? `[链接] ${title}` : '[链接]' + case '6': + return title ? `[文件] ${title}` : '[文件]' + case '19': + return title ? `[聊天记录] ${title}` : '[聊天记录]' + case '33': + case '36': + return title ? `[小程序] ${title}` : '[小程序]' + case '57': + return msg.parsedContent || title || '[引用消息]' + case '2000': + return title ? `[转账] ${title}` : '[转账]' + case '2001': + return title ? `[红包] ${title}` : '[红包]' + case '3': + return title ? `[音乐] ${title}` : '[音乐]' + default: + return msg.parsedContent || title || '[消息]' + } + } + /** * 获取消息内容 */ private getMessageContent(msg: Message): string | null { + if (msg.localType === 49) { + return this.getType49Content(msg) + } + // 优先使用已解析的内容 if (msg.parsedContent) { return msg.parsedContent @@ -1276,7 +1363,7 @@ class HttpService { case 48: return '[位置]' case 49: - return msg.linkTitle || msg.fileName || '[消息]' + return this.getType49Content(msg) default: return msg.rawContent || null } From 262b3622dd110e8e6829a9ac69c002b8312b7a07 Mon Sep 17 00:00:00 2001 From: cc <98377878+hicccc77@users.noreply.github.com> Date: Fri, 20 Mar 2026 22:39:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 586b166..7600b8f 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,19 @@ WeFlow 是一个**完全本地**的微信**实时**聊天记录查看、分析 - HTTP API 接口(供开发者集成) - 查看完整能力清单:[详细功能](#详细功能清单) +## 支持平台与设备 + + +| 平台 | 设备/架构 | 安装包 | +|------|----------|--------| +| Windows | Windows10+、x64(amd64) | `.exe` | +| macOS | Apple Silicon(M 系列,arm64) | `.dmg` | +| Linux | x64 设备(amd64) | `.deb`、`.tar.gz` | + + ## 快速开始 -若你只想使用成品版本,可前往 Release 下载并安装。 +若你只想使用成品版本,可前往 [Releases](https://github.com/hicccc77/WeFlow/releases) 下载并安装。 ## 详细功能清单