这个就需要使用循环了~把isleader循环出来~- {
- "Result": true,
- "Message": null,
- "OrganizationInfos": [
- {
- "ParentOrganizationPath": "",
- "OrganizationPath": "GrapeCity",
- "OrganizationName": "GrapeCity",
- "OrganizationLevelName": "Company",
- "SubOrganizations": [
- {
- "ParentOrganizationPath": "GrapeCity",
- "OrganizationPath": "GrapeCity/Development1",
- "OrganizationName": "Development1",
- "OrganizationLevelName": "Department",
- "SubOrganizations": [...],
- "Members": [...]
- }
- ],
- "Members": [
- {
- "UserName": "David",
- "IsWindowsUser": false,
- "IsLeader": false,
- "OrganizationRole": "Intern"
- },
- {
- "UserName": "Alex",
- "IsWindowsUser": true,
- "IsLeader": true,
- "OrganizationRole": "Developer"
- }
- ]
- },
- {
- "ParentOrganizationPath": "",
- "OrganizationPath": "GrapeSeed",
- "OrganizationName": "GrapeSeed",
- "OrganizationLevelName": "Company",
- "SubOrganizations": [
- {
- "ParentOrganizationPath": "GrapeSeed",
- "OrganizationPath": "GrapeSeed/Development1",
- "OrganizationName": "Development1",
- "OrganizationLevelName": "Department",
- "SubOrganizations": [...],
- "Members": [...]
- }
- ],
- "Members": [
- {
- "UserName": "David",
- "IsWindowsUser": false,
- "IsLeader": false,
- "OrganizationRole": "Intern"
- },
- {
- "UserName": "Alex",
- "IsWindowsUser": true,
- "IsLeader": false,
- "OrganizationRole": "Teacher"
- }
- ]
- }
- ]
- }
复制代码 先搞清楚这段json的层级关系,如果看不出来,可以使用一下:
传送门:https://www.bejson.com/explore/index_new/
每一个层级前面都会有一个tab缩进,另外-代表展开,+代表折叠;
根据这个层级我们可以看出,您要找的isleader在OrganizationInfos-Members-IsLeader下,但是我们又发现OrganizationInfos下有两个数组,因此我们要先循环OrganizationInfos然后再循环Members
|