Compare commits

..
4 Commits
Author SHA1 Message Date
电摇小子 eb60ce4984 chore: 提升版本更新README 2026-01-14 16:28:37 +08:00
电摇小子 061086f0ad docs: 更新README 2026-01-04 16:08:37 +08:00
qingmaoandGitHub d1cb6277f9 Merge pull request #2 from Wxw-Gu/fix-issue-1
Fixes #1: 修复个人聊天界面和导出csv文件不显示名称问题
2026-01-04 15:57:10 +08:00
电摇小子 02baed9bb6 fix: 修复个人聊天界面和导出csv文件不显示名称问题,fix #1 2026-01-04 15:53:26 +08:00
5 changed files with 48 additions and 10 deletions
+8 -1
View File
@@ -9,7 +9,14 @@ MAC系统 获取微信聊天记录 AI一键生成群聊总结
<img src="./public/example2.png" alt="预览图2" />
<img src="./public/example3.png" alt="预览图3" />
## [点击这里下载](https://github.com/Wxw-Gu/WechatExplorer/releases/tag/v1.0.0)
## [点击这里下载](https://github.com/Wxw-Gu/WechatExplorer/releases)
## 📦 安装说明
1. 下载下方的 `xxx.dmg` 文件。
2. 打开 DMG 并将应用拖动到 **Applications** (应用程序) 文件夹。
3. 如果遇到“无法打开,因为开发者无法验证”的提示,请前往:
`系统设置 -> 隐私与安全性 -> 仍要打开`
## ✨ 功能特性
+13 -2
View File
@@ -1,6 +1,6 @@
{
"name": "wechatexplorer",
"version": "1.0.1",
"version": "1.0.3",
"description": "mac 版本获取微信聊天记录, AI群聊总结助手",
"keywords": [
"wechat",
@@ -23,7 +23,9 @@
"postinstall": "electron-builder install-app-deps",
"build:unpack": "npm run build && electron-builder --dir",
"build:win": "npm run build && electron-builder --win",
"build:mac": "electron-vite build && electron-builder --mac",
"build:mac:x64": "electron-vite build && electron-builder --mac --x64",
"build:mac:arm64": "electron-vite build && electron-builder --mac --arm64",
"release:mac": "electron-vite build && electron-builder --mac --x64 --arm64 --publish always",
"build:linux": "electron-vite build && electron-builder --linux"
},
"dependencies": {
@@ -61,5 +63,14 @@
"electron",
"esbuild"
]
},
"build": {
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}",
"mac": {
"target": [
"dmg",
"zip"
]
}
}
}
+1 -3
View File
@@ -161,14 +161,12 @@ app.whenReady().then(() => {
return {
id: msg.mesLocalID || Math.random().toString(),
from: msg.mesDes === '1' ? 'user' : 'assistant', // 1 通常是接收到的,0 是发送的?需要验证。Swift 说:[1: "user", 0: "assistant"]
from: msg.mesDes === 1 ? 'user' : 'assistant', // 1 通常是接收到的,0 是发送的?需要验证。Swift 说:[1: "user", 0: "assistant"]
type: MSG_TYPE_DICT[msgType] || msg.messageType,
datetime: date.toLocaleString('zh-CN', { hour12: false }),
content: content,
isSender: msg.mesDes === '0',
img: img,
name: name
// 实际上让我们坚持我们观察到的:1=用户(其他人), 0=助手(我)
}
})
})
+1 -1
View File
@@ -13,7 +13,7 @@ export interface UserContact {
export interface WechatMessage {
mesLocalID: string
mesDes: string
mesDes: number
messageType: string
msgCreateTime: string
msgContent: string
+25 -3
View File
@@ -39,6 +39,7 @@ const ChatWindow: React.FC<ChatWindowProps> = ({
onRefresh,
onRefreshData
}) => {
const isGroupChat = contact?.type === 'group' || contact?.m_nsUsrName?.endsWith('@chatroom')
const messagesEndRef = useRef<HTMLDivElement>(null)
const imageContainerRef = useRef<HTMLDivElement>(null)
const [generatedImage, setGeneratedImage] = useState<string | null>(null)
@@ -115,11 +116,16 @@ const ChatWindow: React.FC<ChatWindowProps> = ({
// 昨天
const startOfYesterday = startOfDay - 86400000
return parsed >= startOfYesterday && parsed < startOfDay
} else {
} else if (days === 7) {
// 过去 7 天
const startOf7DaysAgo = startOfDay - 7 * 86400000
return parsed >= startOf7DaysAgo
} else if (days === 30) {
// 过去 30 天
const startOf30DaysAgo = startOfDay - 30 * 86400000
return parsed >= startOf30DaysAgo
}
return true
})
}
@@ -127,7 +133,15 @@ const ChatWindow: React.FC<ChatWindowProps> = ({
const csvContent = [
headers.join(','),
...filtered.map((m) => {
const content = m.content.replace(/"/g, '""').replace(/\n/g, ' ')
let prefix = ''
if (isGroupChat) {
prefix = m.name ? `${m.name}: ` : ''
} else {
const name = m.from === 'user' ? contact?.m_nsNickName || '未知' : '我'
prefix = `${name}: `
}
const fullContent = `${prefix}${m.content}`
const content = fullContent.replace(/"/g, '""').replace(/\n/g, ' ')
return `"${m.from}","${m.type}","${m.datetime}","${content}"`
})
].join('\n')
@@ -300,7 +314,12 @@ const ChatWindow: React.FC<ChatWindowProps> = ({
display: !showAvatar ? 'flex' : 'block'
}}
>
{msg.name && <div style={{ fontSize: 18 }}>{msg.name}: </div>}
{(msg.name || contact.m_nsNickName) && (
<div style={{ display: 'flex', fontSize: 18 }}>
{isGroupChat ? msg.name : msg.from === 'user' ? contact.m_nsNickName : '我'}
<span>{isGroupChat ? (msg.name ? ':' : '') : ':'} </span>
</div>
)}
<div
style={{
fontSize: 18,
@@ -367,6 +386,9 @@ const ChatWindow: React.FC<ChatWindowProps> = ({
<button className="toolbar-btn" onClick={() => handleExport(7)}>
📅 7
</button>
<button className="toolbar-btn" onClick={() => handleExport(30)}>
📅 30
</button>
<button className="toolbar-btn" onClick={() => setShowSettingsModal(true)}>
🤖 AI总结群聊
</button>