Просмотр исходного кода

处理管理员非公司挂取

anderx лет назад: 2
Родитель
Сommit
d33cef559e

+ 4 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java

@@ -317,11 +317,13 @@ public class SysDeptServiceImpl implements ISysDeptService
     public Long selectCompanyByDeptId() {
         if (SecurityUtils.hashRoles(UserRolesType.ADMIN.getCode())){
             return null;
-        }else if (SecurityUtils.hashRoles(UserRolesType.CEO.getCode())){
-            return SecurityUtils.getDeptId();
         }
         SysDept sysDept = SecurityUtils.getLoginUser().getUser().getDept();
         String[] split = sysDept.getAncestors().split(",");
+        if (SecurityUtils.hashRoles(UserRolesType.CEO.getCode())){
+            if (split.length==2) SecurityUtils.getDeptId();
+            if (split.length>2)return Long.valueOf(split[2]);
+        }
         if (split.length==2)return Long.valueOf(split[1]);
         if (split.length>2)return Long.valueOf(split[2]);
         return null;