瀏覽代碼

处理管理员非公司挂取

anderx 2 年之前
父節點
當前提交
d33cef559e
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java

+ 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;