Forráskód Böngészése

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

zuohuaijun 2 éve
szülő
commit
e2e9c9b6ef

+ 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();
     }