Prechádzať zdrojové kódy

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

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

罗三疯 2 rokov pred
rodič
commit
731c093554

+ 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)
         {