mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-24 23:06:51 +00:00
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
|||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 22.12
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
@@ -58,4 +58,4 @@ jobs:
|
|||||||
[点击加入 Telegram 群](https://t.me/+hn3QzNc4DbA0MzNl)
|
[点击加入 Telegram 群](https://t.me/+hn3QzNc4DbA0MzNl)
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
gh release edit "$GITHUB_REF_NAME" --notes-file release_notes.md
|
gh release edit "$GITHUB_REF_NAME" --notes-file release_notes.md
|
||||||
|
|||||||
@@ -674,6 +674,10 @@ function registerIpcHandlers() {
|
|||||||
return dbPathService.scanWxids(rootPath)
|
return dbPathService.scanWxids(rootPath)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
ipcMain.handle('dbpath:scanWxidCandidates', async (_, rootPath: string) => {
|
||||||
|
return dbPathService.scanWxidCandidates(rootPath)
|
||||||
|
})
|
||||||
|
|
||||||
ipcMain.handle('dbpath:getDefault', async () => {
|
ipcMain.handle('dbpath:getDefault', async () => {
|
||||||
return dbPathService.getDefaultPath()
|
return dbPathService.getDefaultPath()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
|||||||
dbPath: {
|
dbPath: {
|
||||||
autoDetect: () => ipcRenderer.invoke('dbpath:autoDetect'),
|
autoDetect: () => ipcRenderer.invoke('dbpath:autoDetect'),
|
||||||
scanWxids: (rootPath: string) => ipcRenderer.invoke('dbpath:scanWxids', rootPath),
|
scanWxids: (rootPath: string) => ipcRenderer.invoke('dbpath:scanWxids', rootPath),
|
||||||
|
scanWxidCandidates: (rootPath: string) => ipcRenderer.invoke('dbpath:scanWxidCandidates', rootPath),
|
||||||
getDefault: () => ipcRenderer.invoke('dbpath:getDefault')
|
getDefault: () => ipcRenderer.invoke('dbpath:getDefault')
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -118,6 +118,48 @@ export class DbPathService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫描目录名候选(仅包含下划线的文件夹,排除 all_users)
|
||||||
|
*/
|
||||||
|
scanWxidCandidates(rootPath: string): WxidInfo[] {
|
||||||
|
const wxids: WxidInfo[] = []
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (existsSync(rootPath)) {
|
||||||
|
const entries = readdirSync(rootPath)
|
||||||
|
for (const entry of entries) {
|
||||||
|
const entryPath = join(rootPath, entry)
|
||||||
|
let stat: ReturnType<typeof statSync>
|
||||||
|
try {
|
||||||
|
stat = statSync(entryPath)
|
||||||
|
} catch {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!stat.isDirectory()) continue
|
||||||
|
const lower = entry.toLowerCase()
|
||||||
|
if (lower === 'all_users') continue
|
||||||
|
if (!entry.includes('_')) continue
|
||||||
|
|
||||||
|
wxids.push({ wxid: entry, modifiedTime: stat.mtimeMs })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wxids.length === 0) {
|
||||||
|
const rootName = basename(rootPath)
|
||||||
|
if (rootName.includes('_') && rootName.toLowerCase() !== 'all_users') {
|
||||||
|
const rootStat = statSync(rootPath)
|
||||||
|
wxids.push({ wxid: rootName, modifiedTime: rootStat.mtimeMs })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch { }
|
||||||
|
|
||||||
|
return wxids.sort((a, b) => {
|
||||||
|
if (b.modifiedTime !== a.modifiedTime) return b.modifiedTime - a.modifiedTime
|
||||||
|
return a.wxid.localeCompare(b.wxid)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 扫描 wxid 列表
|
* 扫描 wxid 列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ export class KeyService {
|
|||||||
private GetWindowThreadProcessId: any = null
|
private GetWindowThreadProcessId: any = null
|
||||||
private IsWindowVisible: any = null
|
private IsWindowVisible: any = null
|
||||||
private EnumChildWindows: any = null
|
private EnumChildWindows: any = null
|
||||||
|
private PostMessageW: any = null
|
||||||
private WNDENUMPROC_PTR: any = null
|
private WNDENUMPROC_PTR: any = null
|
||||||
|
|
||||||
// Advapi32
|
// Advapi32
|
||||||
@@ -57,6 +58,7 @@ export class KeyService {
|
|||||||
private readonly HKEY_LOCAL_MACHINE = 0x80000002
|
private readonly HKEY_LOCAL_MACHINE = 0x80000002
|
||||||
private readonly HKEY_CURRENT_USER = 0x80000001
|
private readonly HKEY_CURRENT_USER = 0x80000001
|
||||||
private readonly ERROR_SUCCESS = 0
|
private readonly ERROR_SUCCESS = 0
|
||||||
|
private readonly WM_CLOSE = 0x0010
|
||||||
|
|
||||||
private getDllPath(): string {
|
private getDllPath(): string {
|
||||||
const isPackaged = typeof app !== 'undefined' && app ? app.isPackaged : process.env.NODE_ENV === 'production'
|
const isPackaged = typeof app !== 'undefined' && app ? app.isPackaged : process.env.NODE_ENV === 'production'
|
||||||
@@ -224,6 +226,7 @@ export class KeyService {
|
|||||||
|
|
||||||
this.EnumWindows = this.user32.func('EnumWindows', 'bool', [this.WNDENUMPROC_PTR, 'intptr_t'])
|
this.EnumWindows = this.user32.func('EnumWindows', 'bool', [this.WNDENUMPROC_PTR, 'intptr_t'])
|
||||||
this.EnumChildWindows = this.user32.func('EnumChildWindows', 'bool', ['void*', this.WNDENUMPROC_PTR, 'intptr_t'])
|
this.EnumChildWindows = this.user32.func('EnumChildWindows', 'bool', ['void*', this.WNDENUMPROC_PTR, 'intptr_t'])
|
||||||
|
this.PostMessageW = this.user32.func('PostMessageW', 'bool', ['void*', 'uint32', 'uintptr_t', 'intptr_t'])
|
||||||
|
|
||||||
this.GetWindowTextW = this.user32.func('GetWindowTextW', 'int', ['void*', this.koffi.out('uint16*'), 'int'])
|
this.GetWindowTextW = this.user32.func('GetWindowTextW', 'int', ['void*', this.koffi.out('uint16*'), 'int'])
|
||||||
this.GetWindowTextLengthW = this.user32.func('GetWindowTextLengthW', 'int', ['void*'])
|
this.GetWindowTextLengthW = this.user32.func('GetWindowTextLengthW', 'int', ['void*'])
|
||||||
@@ -437,16 +440,60 @@ export class KeyService {
|
|||||||
return fallbackPid ?? null
|
return fallbackPid ?? null
|
||||||
}
|
}
|
||||||
|
|
||||||
private async killWeChatProcesses() {
|
private async waitForWeChatExit(timeoutMs = 8000): Promise<boolean> {
|
||||||
|
const start = Date.now()
|
||||||
|
while (Date.now() - start < timeoutMs) {
|
||||||
|
const weixinPid = await this.findPidByImageName('Weixin.exe')
|
||||||
|
const wechatPid = await this.findPidByImageName('WeChat.exe')
|
||||||
|
if (!weixinPid && !wechatPid) return true
|
||||||
|
await new Promise(r => setTimeout(r, 400))
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
private async closeWeChatWindows(): Promise<boolean> {
|
||||||
|
if (!this.ensureUser32()) return false
|
||||||
|
let requested = false
|
||||||
|
|
||||||
|
const enumWindowsCallback = this.koffi.register((hWnd: any, lParam: any) => {
|
||||||
|
if (!this.IsWindowVisible(hWnd)) return true
|
||||||
|
const title = this.getWindowTitle(hWnd)
|
||||||
|
const className = this.getClassName(hWnd)
|
||||||
|
const classLower = (className || '').toLowerCase()
|
||||||
|
const isWeChatWindow = this.isWeChatWindowTitle(title) || classLower.includes('wechat') || classLower.includes('weixin')
|
||||||
|
if (!isWeChatWindow) return true
|
||||||
|
|
||||||
|
requested = true
|
||||||
|
try {
|
||||||
|
this.PostMessageW?.(hWnd, this.WM_CLOSE, 0, 0)
|
||||||
|
} catch { }
|
||||||
|
return true
|
||||||
|
}, this.WNDENUMPROC_PTR)
|
||||||
|
|
||||||
|
this.EnumWindows(enumWindowsCallback, 0)
|
||||||
|
this.koffi.unregister(enumWindowsCallback)
|
||||||
|
|
||||||
|
return requested
|
||||||
|
}
|
||||||
|
|
||||||
|
private async killWeChatProcesses(): Promise<boolean> {
|
||||||
|
const requested = await this.closeWeChatWindows()
|
||||||
|
if (requested) {
|
||||||
|
const gracefulOk = await this.waitForWeChatExit(1500)
|
||||||
|
if (gracefulOk) return true
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await execFileAsync('taskkill', ['/F', '/IM', 'Weixin.exe'])
|
await execFileAsync('taskkill', ['/F', '/T', '/IM', 'Weixin.exe'])
|
||||||
await execFileAsync('taskkill', ['/F', '/IM', 'WeChat.exe'])
|
await execFileAsync('taskkill', ['/F', '/T', '/IM', 'WeChat.exe'])
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Ignore if not found
|
// Ignore if not found
|
||||||
}
|
}
|
||||||
await new Promise(r => setTimeout(r, 1000))
|
|
||||||
|
return await this.waitForWeChatExit(5000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// --- Window Detection ---
|
// --- Window Detection ---
|
||||||
|
|
||||||
private getWindowTitle(hWnd: any): string {
|
private getWindowTitle(hWnd: any): string {
|
||||||
@@ -605,15 +652,24 @@ export class KeyService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 2. Restart WeChat
|
// 2. Restart WeChat
|
||||||
onStatus?.('正在重启微信以进行获取...', 0)
|
onStatus?.('正在关闭微信以进行获取...', 0)
|
||||||
await this.killWeChatProcesses()
|
const closed = await this.killWeChatProcesses()
|
||||||
|
if (!closed) {
|
||||||
|
const err = '无法自动关闭微信,请手动退出后重试'
|
||||||
|
onStatus?.(err, 2)
|
||||||
|
return { success: false, error: err }
|
||||||
|
}
|
||||||
|
|
||||||
// 3. Launch
|
// 3. Launch
|
||||||
onStatus?.('正在启动微信...', 0)
|
onStatus?.('正在启动微信...', 0)
|
||||||
const sub = spawn(wechatPath, { detached: true, stdio: 'ignore' })
|
const sub = spawn(wechatPath, {
|
||||||
|
detached: true,
|
||||||
|
stdio: 'ignore',
|
||||||
|
cwd: dirname(wechatPath)
|
||||||
|
})
|
||||||
sub.unref()
|
sub.unref()
|
||||||
|
|
||||||
// 4. Wait for Window & Get PID (Crucial change: discover PID from window)
|
// 4. Wait for Window & Get PID (Crucial change: discover PID from window)
|
||||||
onStatus?.('等待微信界面就绪...', 0)
|
onStatus?.('等待微信界面就绪...', 0)
|
||||||
const pid = await this.waitForWeChatWindow()
|
const pid = await this.waitForWeChatWindow()
|
||||||
if (!pid) {
|
if (!pid) {
|
||||||
|
|||||||
15
package-lock.json
generated
15
package-lock.json
generated
@@ -1,15 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "weflow",
|
"name": "weflow",
|
||||||
"version": "1.4.2",
|
"version": "1.4.4",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "weflow",
|
"name": "weflow",
|
||||||
"version": "1.4.2",
|
"version": "1.4.4",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nodert-win10-rs4/windows.security.credentials.ui": "^0.4.4",
|
|
||||||
"better-sqlite3": "^12.5.0",
|
"better-sqlite3": "^12.5.0",
|
||||||
"echarts": "^5.5.1",
|
"echarts": "^5.5.1",
|
||||||
"echarts-for-react": "^3.0.2",
|
"echarts-for-react": "^3.0.2",
|
||||||
@@ -1949,16 +1948,6 @@
|
|||||||
"node": ">= 10.0.0"
|
"node": ">= 10.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@nodert-win10-rs4/windows.security.credentials.ui": {
|
|
||||||
"version": "0.4.4",
|
|
||||||
"resolved": "https://registry.npmmirror.com/@nodert-win10-rs4/windows.security.credentials.ui/-/windows.security.credentials.ui-0.4.4.tgz",
|
|
||||||
"integrity": "sha512-P+EsJw5MCQXTxp7mwXfNDvIzIYsB6ple+HNg01QjPWg/PJfAodPuxL6XM7l0sPtYHsDYnfnvoefZMdZRa2Z1ig==",
|
|
||||||
"hasInstallScript": true,
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"dependencies": {
|
|
||||||
"nan": "latest"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@npmcli/agent": {
|
"node_modules/@npmcli/agent": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmmirror.com/@npmcli/agent/-/agent-3.0.0.tgz",
|
"resolved": "https://registry.npmmirror.com/@npmcli/agent/-/agent-3.0.0.tgz",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "weflow",
|
"name": "weflow",
|
||||||
"version": "1.4.2",
|
"version": "1.4.4",
|
||||||
"description": "WeFlow",
|
"description": "WeFlow",
|
||||||
"main": "dist-electron/main.js",
|
"main": "dist-electron/main.js",
|
||||||
"author": "cc",
|
"author": "cc",
|
||||||
@@ -15,7 +15,6 @@
|
|||||||
"electron:build": "npm run build"
|
"electron:build": "npm run build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nodert-win10-rs4/windows.security.credentials.ui": "^0.4.4",
|
|
||||||
"better-sqlite3": "^12.5.0",
|
"better-sqlite3": "^12.5.0",
|
||||||
"echarts": "^5.5.1",
|
"echarts": "^5.5.1",
|
||||||
"echarts-for-react": "^3.0.2",
|
"echarts-for-react": "^3.0.2",
|
||||||
@@ -127,4 +126,4 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -435,6 +435,58 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wxid-select {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wxid-dropdown {
|
||||||
|
position: absolute;
|
||||||
|
top: calc(100% + 6px);
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
background: var(--bg-primary);
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 6px;
|
||||||
|
max-height: 220px;
|
||||||
|
overflow: auto;
|
||||||
|
z-index: 20;
|
||||||
|
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
.wxid-option {
|
||||||
|
width: 100%;
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 10px 12px;
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: var(--text-primary);
|
||||||
|
font-size: 13px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: var(--bg-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
background: var(--primary-light);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.wxid-name {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wxid-time {
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
font-size: 12px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
.field-with-toggle {
|
.field-with-toggle {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
@@ -750,4 +802,4 @@
|
|||||||
transform: scale(1);
|
transform: scale(1);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useState, useEffect } from 'react'
|
import { useState, useEffect, useRef } from 'react'
|
||||||
import { useNavigate } from 'react-router-dom'
|
import { useNavigate } from 'react-router-dom'
|
||||||
import { useAppStore } from '../stores/appStore'
|
import { useAppStore } from '../stores/appStore'
|
||||||
import { dialog } from '../services/ipc'
|
import { dialog } from '../services/ipc'
|
||||||
@@ -35,6 +35,8 @@ function WelcomePage({ standalone = false }: WelcomePageProps) {
|
|||||||
const [cachePath, setCachePath] = useState('')
|
const [cachePath, setCachePath] = useState('')
|
||||||
const [wxid, setWxid] = useState('')
|
const [wxid, setWxid] = useState('')
|
||||||
const [wxidOptions, setWxidOptions] = useState<Array<{ wxid: string; modifiedTime: number }>>([])
|
const [wxidOptions, setWxidOptions] = useState<Array<{ wxid: string; modifiedTime: number }>>([])
|
||||||
|
const [showWxidSelect, setShowWxidSelect] = useState(false)
|
||||||
|
const wxidSelectRef = useRef<HTMLDivElement>(null)
|
||||||
const [error, setError] = useState('')
|
const [error, setError] = useState('')
|
||||||
const [isConnecting, setIsConnecting] = useState(false)
|
const [isConnecting, setIsConnecting] = useState(false)
|
||||||
const [isDetectingPath, setIsDetectingPath] = useState(false)
|
const [isDetectingPath, setIsDetectingPath] = useState(false)
|
||||||
@@ -127,8 +129,22 @@ function WelcomePage({ standalone = false }: WelcomePageProps) {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setWxidOptions([])
|
setWxidOptions([])
|
||||||
setWxid('')
|
setWxid('')
|
||||||
|
setShowWxidSelect(false)
|
||||||
}, [dbPath])
|
}, [dbPath])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const handleClickOutside = (event: MouseEvent) => {
|
||||||
|
if (!showWxidSelect) return
|
||||||
|
const target = event.target as Node
|
||||||
|
if (wxidSelectRef.current && !wxidSelectRef.current.contains(target)) {
|
||||||
|
setShowWxidSelect(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener('mousedown', handleClickOutside)
|
||||||
|
return () => document.removeEventListener('mousedown', handleClickOutside)
|
||||||
|
}, [showWxidSelect])
|
||||||
|
|
||||||
const currentStep = steps[stepIndex]
|
const currentStep = steps[stepIndex]
|
||||||
const rootClassName = `welcome-page${isClosing ? ' is-closing' : ''}${standalone ? ' is-standalone' : ''}`
|
const rootClassName = `welcome-page${isClosing ? ' is-closing' : ''}${standalone ? ' is-standalone' : ''}`
|
||||||
const showWindowControls = standalone
|
const showWindowControls = standalone
|
||||||
@@ -217,6 +233,28 @@ function WelcomePage({ standalone = false }: WelcomePageProps) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleScanWxidCandidates = async () => {
|
||||||
|
if (!dbPath) {
|
||||||
|
setError('请先选择数据库目录')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (isScanningWxid) return
|
||||||
|
setIsScanningWxid(true)
|
||||||
|
setError('')
|
||||||
|
try {
|
||||||
|
const wxids = await window.electronAPI.dbPath.scanWxidCandidates(dbPath)
|
||||||
|
setWxidOptions(wxids)
|
||||||
|
setShowWxidSelect(true)
|
||||||
|
if (!wxids.length) {
|
||||||
|
setError('未检测到可用的账号目录,请检查路径')
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
setError(`扫描失败: ${e}`)
|
||||||
|
} finally {
|
||||||
|
setIsScanningWxid(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const handleAutoGetDbKey = async () => {
|
const handleAutoGetDbKey = async () => {
|
||||||
if (isFetchingDbKey) return
|
if (isFetchingDbKey) return
|
||||||
setIsFetchingDbKey(true)
|
setIsFetchingDbKey(true)
|
||||||
@@ -556,14 +594,35 @@ function WelcomePage({ standalone = false }: WelcomePageProps) {
|
|||||||
{currentStep.id === 'key' && (
|
{currentStep.id === 'key' && (
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<label className="field-label">微信账号 (Wxid)</label>
|
<label className="field-label">微信账号 (Wxid)</label>
|
||||||
<input
|
<div className="wxid-select" ref={wxidSelectRef}>
|
||||||
type="text"
|
<input
|
||||||
className="field-input"
|
type="text"
|
||||||
placeholder="等待获取..."
|
className="field-input"
|
||||||
value={wxid}
|
placeholder="点击选择..."
|
||||||
readOnly
|
value={wxid}
|
||||||
onChange={(e) => setWxid(e.target.value)}
|
readOnly
|
||||||
/>
|
onClick={handleScanWxidCandidates}
|
||||||
|
onChange={(e) => setWxid(e.target.value)}
|
||||||
|
/>
|
||||||
|
{showWxidSelect && wxidOptions.length > 0 && (
|
||||||
|
<div className="wxid-dropdown">
|
||||||
|
{wxidOptions.map((opt) => (
|
||||||
|
<button
|
||||||
|
key={opt.wxid}
|
||||||
|
type="button"
|
||||||
|
className={`wxid-option ${opt.wxid === wxid ? 'active' : ''}`}
|
||||||
|
onClick={() => {
|
||||||
|
setWxid(opt.wxid)
|
||||||
|
setShowWxidSelect(false)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span className="wxid-name">{opt.wxid}</span>
|
||||||
|
<span className="wxid-time">{formatModifiedTime(opt.modifiedTime)}</span>
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
<label className="field-label mt-4">解密密钥</label>
|
<label className="field-label mt-4">解密密钥</label>
|
||||||
<div className="field-with-toggle">
|
<div className="field-with-toggle">
|
||||||
@@ -733,4 +792,3 @@ function WelcomePage({ standalone = false }: WelcomePageProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default WelcomePage
|
export default WelcomePage
|
||||||
|
|
||||||
|
|||||||
1
src/types/electron.d.ts
vendored
1
src/types/electron.d.ts
vendored
@@ -42,6 +42,7 @@ export interface ElectronAPI {
|
|||||||
dbPath: {
|
dbPath: {
|
||||||
autoDetect: () => Promise<{ success: boolean; path?: string; error?: string }>
|
autoDetect: () => Promise<{ success: boolean; path?: string; error?: string }>
|
||||||
scanWxids: (rootPath: string) => Promise<WxidInfo[]>
|
scanWxids: (rootPath: string) => Promise<WxidInfo[]>
|
||||||
|
scanWxidCandidates: (rootPath: string) => Promise<WxidInfo[]>
|
||||||
getDefault: () => Promise<string>
|
getDefault: () => Promise<string>
|
||||||
}
|
}
|
||||||
wcdb: {
|
wcdb: {
|
||||||
|
|||||||
Reference in New Issue
Block a user