diff --git a/electron/services/bizService.ts b/electron/services/bizService.ts index 110b22c..034ec28 100644 --- a/electron/services/bizService.ts +++ b/electron/services/bizService.ts @@ -139,9 +139,16 @@ export class BizService { } }) - const contactDbPath = join(root, accountWxid, 'contact.db') + const contactDbPath = join(root, accountWxid, 'db_storage', 'contact', 'contact.db') // ???? + // console.log(`contactDbPath: ${contactDbPath}`) + if (existsSync(contactDbPath)) { + // console.log('ok11') + const bizInfoRes = await wcdbService.execQuery('contact', contactDbPath, 'SELECT username, type FROM biz_info') + + // console.log(JSON.stringify(bizInfoRes, null, 2)) + if (bizInfoRes.success && bizInfoRes.rows) { const typeMap: Record = {} for (const r of bizInfoRes.rows) typeMap[r.username] = r.type @@ -150,7 +157,7 @@ export class BizService { } return result - .filter(acc => !acc.name.includes('朋友圈广告')) + .filter(acc => !acc.name.includes('广告')) .sort((a, b) => { if (a.username === 'gh_3dfda90e39d6') return -1 if (b.username === 'gh_3dfda90e39d6') return 1 diff --git a/src/pages/BizPage.tsx b/src/pages/BizPage.tsx index 457d1b2..ccaf11b 100644 --- a/src/pages/BizPage.tsx +++ b/src/pages/BizPage.tsx @@ -7,7 +7,7 @@ export interface BizAccount { username: string; name: string; avatar: string; - type: number; + type: string; last_time: number; formatted_last_time: string; } @@ -84,18 +84,17 @@ export const BizAccountList: React.FC<{ {item.name || item.username} {item.formatted_last_time} - {item.username === 'gh_3dfda90e39d6' && ( -
服务号
- )} + {/*{item.username === 'gh_3dfda90e39d6' && (*/} + {/*
微信支付
*/} + {/*)}*/} - {/* 我看了下没有接口获取相关type,如果exec没法用的话确实无能为力,后面再适配吧 */} - {/*
*/} - {/* {item.type === 1 ? '服务号' : item.type === 0 ? '订阅号' : item.type === 2 ? '企业号' : '未知'}*/} - {/*
*/} +
+ {item.type === '0' ? '公众号' : item.type === '1' ? '服务号' : item.type === '2' ? '企业号' : '未知'} +