数据权限,可见部门及子级缓存问题

Blade 未结 1 407
ccc
ccc 剑圣 2022-09-30 09:42

一、该问题的重现步骤是什么?

1. 给mapper方法设置数据权限,选择部门及子集可见

2. 这里获取部门自己的方法会从数据库缓存中读取,读取后写入到缓存中。

3. 后台在新增一个部门,这个时候用这个部门新增数据。

4. 用拥有权限的部门访问应该还会读到之前的缓存吧。

5. 这块的逻辑是不是存在问题。

插入了图片就不能编辑了,代码的样式也丢了, 凑合看吧

ListLongLong deptIdList ancestors = CacheUtil.deptIdList.CollectionUtil.ancestorsancestors = .queryForListDataScopeConstant.ObjectdeptIdLong.CacheUtil.deptIdancestorsancestors

新增部门逻辑处也没有清空缓存的逻辑

Dept deptFunc.dept.getParentIddept.setTenantIdAuthUtil.dept.setParentIdBladeConstant.dept.setAncestorsString.BladeConstant.dept.getParentId> Dept parent = getByIddept.getParentIdFunc.dept.getParentId== Func.dept.getIdServiceExceptiondept.setTenantIdparent.getTenantIdString ancestors = parent.getAncestors+ StringPool.+ dept.getParentIddept.setAncestorsancestorsdept.setIsDeletedBladeConstant.saveOrUpdatedept


1条回答
  • 部门修改的时候,缓存已经重置了。

    1Q4JQB6SNPK6Z{SUGCZOEPG.png

    0 讨论(0)
提交回复