diff --git a/cf-framework/cf-spring-boot-starter-biz-organ/src/main/java/com/cf/imes/framework/organ/core/security/OrganSecurityWebFilter.java b/cf-framework/cf-spring-boot-starter-biz-organ/src/main/java/com/cf/imes/framework/organ/core/security/OrganSecurityWebFilter.java index df003173d..e3fcf604c 100644 --- a/cf-framework/cf-spring-boot-starter-biz-organ/src/main/java/com/cf/imes/framework/organ/core/security/OrganSecurityWebFilter.java +++ b/cf-framework/cf-spring-boot-starter-biz-organ/src/main/java/com/cf/imes/framework/organ/core/security/OrganSecurityWebFilter.java @@ -140,7 +140,10 @@ public class OrganSecurityWebFilter extends ApiRequestFilter { ServiceException serviceException = (ServiceException) ex; if (Objects.equals(serviceException.getCode(), ErrorCodeConstants.ORGAN_EXPIRE.getCode()) || Objects.equals(serviceException.getCode(), ErrorCodeConstants.ORGAN_DISABLE.getCode()) - || Objects.equals(serviceException.getCode(), ErrorCodeConstants.ORGAN_NOT_EXISTS.getCode())) { + || Objects.equals(serviceException.getCode(), ErrorCodeConstants.ORGAN_NOT_EXISTS.getCode()) + || Objects.equals(serviceException.getCode(), ErrorCodeConstants.DEPT_DISABLE.getCode()) + || Objects.equals(serviceException.getCode(), ErrorCodeConstants.DEPT_NOT_FOUND.getCode()) + || Objects.equals(serviceException.getCode(), ErrorCodeConstants.DEPT_PARENT_NOT_EXITS.getCode())) { result.setCode(GlobalErrorCodeConstants.UNAUTHORIZED.getCode()); } } diff --git a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/auth/AdminAuthServiceImpl.java b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/auth/AdminAuthServiceImpl.java index f9f226e60..ea402b80b 100644 --- a/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/auth/AdminAuthServiceImpl.java +++ b/cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/auth/AdminAuthServiceImpl.java @@ -26,6 +26,7 @@ import com.cf.imes.module.system.enums.logger.LoginLogTypeEnum; import com.cf.imes.module.system.enums.logger.LoginResultEnum; import com.cf.imes.module.system.enums.oauth2.OAuth2ClientConstants; import com.cf.imes.module.system.enums.sms.SmsSceneEnum; +import com.cf.imes.module.system.service.dept.DeptService; import com.cf.imes.module.system.service.logger.LoginLogService; import com.cf.imes.module.system.service.member.MemberService; import com.cf.imes.module.system.service.oauth2.OAuth2TokenService; @@ -80,6 +81,8 @@ public class AdminAuthServiceImpl implements AdminAuthService { private SmsCodeApi smsCodeApi; @Resource private OrganService organService; + @Resource + private DeptService deptService; @Resource private SmsCodeService smsCodeService; @@ -107,6 +110,8 @@ public class AdminAuthServiceImpl implements AdminAuthService { } // 校验机构有效性 organService.validOrgan(user.getOrganId()); + // 校验部门有效性 + deptService.validDept(user.getDeptId()); // 校验密码 if (!userService.isPasswordMatch(password, user.getPassword())) { createLoginLog(user.getId(), username, logTypeEnum, LoginResultEnum.BAD_CREDENTIALS);