fix: 修复飞书根部门用户获取问题 (#88)
This commit is contained in:
parent
0bdefa9484
commit
458cf59e06
|
@ -57,11 +57,18 @@ func GetAllUsers() (ret []map[string]interface{}, err error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
deptids := make([]string, 0)
|
||||
deptids = append(deptids, "0") // 0 代表根部门
|
||||
for _, dept := range depts {
|
||||
deptids = append(deptids, dept["open_department_id"].(string))
|
||||
}
|
||||
|
||||
for _, deptid := range deptids {
|
||||
req := lark.GetUserListReq{
|
||||
PageSize: &pageSize,
|
||||
PageToken: new(string),
|
||||
DepartmentID: dept["open_department_id"].(string),
|
||||
DepartmentID: deptid,
|
||||
}
|
||||
for {
|
||||
res, _, err := InitFeiShuClient().Contact.GetUserList(context.Background(), &req)
|
||||
|
|
Loading…
Reference in New Issue