소스 검색

update Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarFilter.cs.
//自定义过滤因子由库缩小到用户,这样在自定义过滤类中就可以做一些涉及部门 用户 等更细的过滤

Signed-off-by: 罗三疯 <mis@kingcan.net>

罗三疯 2 년 전
부모
커밋
731c093554
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarFilter.cs

+ 2 - 1
Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarFilter.cs

@@ -133,7 +133,8 @@ public static class SqlSugarFilter
     public static void SetCustomEntityFilter(SqlSugarScopeProvider db)
     {
         // 配置自定义缓存
-        var cacheKey = $"db:{db.CurrentConnectionConfig.ConfigId}:custom";
+        var userId = App.User?.FindFirst(ClaimConst.UserId)?.Value;
+        var cacheKey = $"db:{db.CurrentConnectionConfig.ConfigId}:custom:{userId}";
         var tableFilterItemList = _cache.Get<List<TableFilterItem<object>>>(cacheKey);
         if (tableFilterItemList == null)
         {