【操盘手】 选择好友支持筛选设备
This commit is contained in:
@@ -39,9 +39,10 @@ interface WechatFriendSelectorProps {
|
||||
onOpenChange: (open: boolean) => void
|
||||
selectedFriends: WechatFriend[]
|
||||
onSelect: (friends: WechatFriend[]) => void
|
||||
devices?: number[]
|
||||
}
|
||||
|
||||
export function WechatFriendSelector({ open, onOpenChange, selectedFriends, onSelect }: WechatFriendSelectorProps) {
|
||||
export function WechatFriendSelector({ open, onOpenChange, selectedFriends, onSelect, devices = [] }: WechatFriendSelectorProps) {
|
||||
const [searchQuery, setSearchQuery] = useState("")
|
||||
const [friends, setFriends] = useState<WechatFriend[]>([])
|
||||
const [loading, setLoading] = useState(false)
|
||||
@@ -67,6 +68,10 @@ export function WechatFriendSelector({ open, onOpenChange, selectedFriends, onSe
|
||||
...(searchQuery ? { keyword: searchQuery } : {})
|
||||
})
|
||||
|
||||
if (devices && devices.length > 0) {
|
||||
queryParams.append('deviceIds', devices.join(','))
|
||||
}
|
||||
|
||||
const response = await api.get<ApiResponse<FriendListResponse>>(`/v1/friend?${queryParams.toString()}`)
|
||||
|
||||
if (response.code === 200 && response.data) {
|
||||
|
||||
Reference in New Issue
Block a user