From 2aabdb83ad578b0c9213a18d1fb1257349e2bc3f Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期五, 17 二月 2023 10:47:32 +0800 Subject: [PATCH] fix 修复 管理员登出动态租户未清理导致二次无法登录 --- ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index 453d98f..fda7f62 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -142,13 +142,13 @@ @Override public String selectDeptNameByIds(String deptIds) { List<String> list = new ArrayList<>(); - for (Long id : Arrays.stream(deptIds.split(",")).map(Long::parseLong).toList()) { + for (Long id : StringUtils.splitTo(deptIds, Convert::toLong)) { SysDeptVo vo = SpringUtils.getAopProxy(this).selectDeptById(id); if (ObjectUtil.isNotNull(vo)) { list.add(vo.getDeptName()); } } - return String.join(",", list); + return String.join(StringUtils.SEPARATOR, list); } /** @@ -213,7 +213,7 @@ */ @Override public void checkDeptDataScope(Long deptId) { - if (!LoginHelper.isAdmin()) { + if (!LoginHelper.isSuperAdmin()) { SysDeptBo dept = new SysDeptBo(); dept.setDeptId(deptId); List<SysDeptVo> depts = this.selectDeptList(dept); @@ -237,7 +237,7 @@ throw new ServiceException("閮ㄩ棬鍋滅敤锛屼笉鍏佽鏂板"); } SysDept dept = BeanUtil.toBean(bo, SysDept.class); - dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); + dept.setAncestors(info.getAncestors() + StringUtils.SEPARATOR + dept.getParentId()); return baseMapper.insert(dept); } @@ -254,7 +254,7 @@ SysDept newParentDept = baseMapper.selectById(dept.getParentId()); SysDept oldDept = baseMapper.selectById(dept.getDeptId()); if (ObjectUtil.isNotNull(newParentDept) && ObjectUtil.isNotNull(oldDept)) { - String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId(); + String newAncestors = newParentDept.getAncestors() + StringUtils.SEPARATOR + newParentDept.getDeptId(); String oldAncestors = oldDept.getAncestors(); dept.setAncestors(newAncestors); updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); -- Gitblit v1.9.3