Quellcode durchsuchen

😁修复redis前缀问题

zuohuaijun vor 2 Jahren
Ursprung
Commit
fdb5e92e4d
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      Admin.NET/Admin.NET.Core/Service/Cache/SysCacheService.cs

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

@@ -33,7 +33,7 @@ public class SysCacheService : IDynamicApiController, ISingleton
     {
         return _cache == Cache.Default
             ? _cache.Keys.Where(u => u.StartsWith(_cacheOptions.Prefix)).Select(u => u[_cacheOptions.Prefix.Length..]).OrderBy(u => u).ToList()
-            : ((FullRedis)_cache).Search($"{_cacheOptions.Prefix}*", int.MaxValue).ToList();
+            : ((FullRedis)_cache).Search($"{_cacheOptions.Prefix}*", int.MaxValue).Select(u => u[_cacheOptions.Prefix.Length..]).OrderBy(u => u).ToList();
     }
 
     /// <summary>
@@ -122,7 +122,7 @@ public class SysCacheService : IDynamicApiController, ISingleton
     {
         return _cache == Cache.Default
             ? _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();
+            : ((FullRedis)_cache).Search($"{_cacheOptions.Prefix}{prefixKey}*", int.MaxValue).Select(u => u[_cacheOptions.Prefix.Length..]).ToList();
     }
 
     /// <summary>