Преглед изворни кода

!784 根据键名前缀获取键名集合 问题
Merge pull request !784 from dd/N/A

zuohuaijun пре 2 година
родитељ
комит
e2e9c9b6ef
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      Admin.NET/Admin.NET.Core/Service/Cache/SysCacheService.cs

+ 1 - 1
Admin.NET/Admin.NET.Core/Service/Cache/SysCacheService.cs

@@ -121,7 +121,7 @@ public class SysCacheService : IDynamicApiController, ISingleton
     public List<string> GetKeysByPrefixKey(string prefixKey)
     {
         return _cache == Cache.Default
-            ? _cache.Keys.Where(u => u.StartsWith($"{_cacheOptions.Prefix}{prefixKey}")).ToList()
+            ? _cache.Keys.Where(u => u.StartsWith($"{_cacheOptions.Prefix}{prefixKey}")).Select(u => u[_cacheOptions.Prefix.Length..]).ToList()
             : ((FullRedis)_cache).Search($"{_cacheOptions.Prefix}{prefixKey}*", int.MaxValue).ToList();
     }