lyhzzz 2 years ago
parent
commit
b33bdb2630
1 changed files with 10 additions and 7 deletions
  1. 10 7
      src/main/java/com/fdkankan/fusion/controller/LoginController.java

+ 10 - 7
src/main/java/com/fdkankan/fusion/controller/LoginController.java

@@ -61,13 +61,16 @@ public class LoginController extends BaseController{
         if(tmUser.getStatus() == 0){
             throw new BusinessException(ResultCode.USER_NOT_LOGIN_PERM);
         }
-        List<TmDepartment> deptList = tmDepartmentService.getSonByDeptId(request.getDeptId());
-        if(deptList == null || deptList.size() <=0){
-            throw new BusinessException(ResultCode.DEPT_NOT_EXITS);
-        }
-        List<String> deptIds = deptList.stream().map(TmDepartment::getId).collect(Collectors.toList());
-        if(!deptIds.contains(tmUser.getDeptId())){
-            throw new BusinessException(ResultCode.PASSWORD_ERROR);
+        //超管除外
+        if(!tmUser.getDeptId().equals("0")){
+            List<TmDepartment> deptList = tmDepartmentService.getSonByDeptId(request.getDeptId());
+            if(deptList == null || deptList.size() <=0){
+                throw new BusinessException(ResultCode.DEPT_NOT_EXITS);
+            }
+            List<String> deptIds = deptList.stream().map(TmDepartment::getId).collect(Collectors.toList());
+            if(!deptIds.contains(tmUser.getDeptId())){
+                throw new BusinessException(ResultCode.PASSWORD_ERROR);
+            }
         }
 
         //对前端传的密码解密