|
@@ -107,7 +107,11 @@ public class DingUtil {
|
|
|
req.setCode(code);
|
|
|
String corpAccessToken = getCorpAccessToken(corpId);
|
|
|
OapiV2UserGetuserinfoResponse rsp = client.execute(req, corpAccessToken);
|
|
|
- return rsp.getResult();
|
|
|
+ OapiV2UserGetuserinfoResponse.UserGetByCodeResponse result = rsp.getResult();
|
|
|
+ if (result == null) {
|
|
|
+ throw new ServiceException(rsp.getErrmsg());
|
|
|
+ }
|
|
|
+ return result;
|
|
|
} catch (Exception e) {
|
|
|
log.error("通过免登码获取用户信息失败", e);
|
|
|
throw new ServiceException("通过免登码获取用户信息失败");
|
|
@@ -128,7 +132,6 @@ public class DingUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
public static List<OapiV2DepartmentListsubResponse.DeptBaseResponse> getDeptList(String corpId, Long deptId) {
|
|
|
try {
|
|
|
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/department/listsub");
|