通讯录可勾选部分好友导出

This commit is contained in:
xuncha
2026-02-19 16:49:46 +08:00
parent 89783b4d45
commit 25325e80ee
3 changed files with 130 additions and 23 deletions

View File

@@ -10,6 +10,7 @@ interface ContactExportOptions {
groups: boolean
officials: boolean
}
selectedUsernames?: string[]
}
/**
@@ -40,6 +41,11 @@ class ContactExportService {
return true
})
if (Array.isArray(options.selectedUsernames) && options.selectedUsernames.length > 0) {
const selectedSet = new Set(options.selectedUsernames)
contacts = contacts.filter(c => selectedSet.has(c.username))
}
if (contacts.length === 0) {
return { success: false, error: '没有符合条件的联系人' }
}