mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-13 05:12:07 +08:00
新增-es查询缺少字段判断,部门不存在时也可以登录
This commit is contained in:
+1
-1
@@ -111,7 +111,7 @@ public class AdminAuthServiceImpl implements AdminAuthService {
|
||||
// 校验机构有效性
|
||||
organService.validOrgan(user.getOrganId());
|
||||
// 校验部门有效性
|
||||
deptService.validDept(user.getDeptId());
|
||||
deptService.validUserLoginDept(user.getDeptId());
|
||||
// 校验密码
|
||||
if (!userService.isPasswordMatch(password, user.getPassword())) {
|
||||
createLoginLog(user.getId(), username, logTypeEnum, LoginResultEnum.BAD_CREDENTIALS);
|
||||
|
||||
+7
@@ -106,6 +106,13 @@ public interface DeptService {
|
||||
*/
|
||||
void validDept(Long deptId);
|
||||
|
||||
/**
|
||||
* 用户登陆时部门校验
|
||||
*
|
||||
* @param deptId
|
||||
*/
|
||||
void validUserLoginDept(Long deptId);
|
||||
|
||||
/**
|
||||
* 移除没有归属(上级)的部门
|
||||
*
|
||||
|
||||
+19
@@ -309,6 +309,25 @@ public class DeptServiceImpl implements DeptService {
|
||||
validParentDept(deptDO);
|
||||
}
|
||||
|
||||
|
||||
// 用户登陆时部门校验,部门不存在时也可以进行登录
|
||||
@Override
|
||||
public void validUserLoginDept(Long deptId){
|
||||
DeptDO deptDO = deptMapper.selectById(deptId);
|
||||
if (deptDO == null) {
|
||||
return;
|
||||
}
|
||||
if (!CommonStatusEnum.ENABLE.getStatus().equals(deptDO.getStatus())) {
|
||||
throw ServiceExceptionUtil.exception(ErrorCodeConstants.DEPT_DISABLE, deptDO.getName());
|
||||
}
|
||||
// 递归校验上级部门
|
||||
validParentDept(deptDO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 递归校验上级部门
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user