|
@@ -70,14 +70,13 @@ public class AuthServiceImpl implements AuthService {
|
|
throw new StatusException("B-001001", "domain,rootOrgId 必须有一个不为空");
|
|
throw new StatusException("B-001001", "domain,rootOrgId 必须有一个不为空");
|
|
}
|
|
}
|
|
|
|
|
|
- rootOrg = orgRepo.findFirstByParentIdAndCode(0L, loginInfo.getDomain());
|
|
|
|
-
|
|
|
|
- if (null == rootOrg) {
|
|
|
|
- throw new StatusException("B-001002", "机构不存在");
|
|
|
|
|
|
+ try {
|
|
|
|
+ rootOrg = orgRepo.findFirstByParentIdAndCode(0L, loginInfo.getDomain());
|
|
|
|
+ rootOrgId = String.valueOf(rootOrg.getId());
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new StatusException("B-001002", "机构不存在", e);
|
|
}
|
|
}
|
|
|
|
|
|
- rootOrgId = String.valueOf(rootOrg.getId());
|
|
|
|
-
|
|
|
|
} else {
|
|
} else {
|
|
rootOrg = orgRepo.findOne(Long.valueOf(rootOrgId));
|
|
rootOrg = orgRepo.findOne(Long.valueOf(rootOrgId));
|
|
if (null == rootOrg) {
|
|
if (null == rootOrg) {
|