Ver Fonte

update Admin.NET/Admin.NET.Core/Service/Cache/SysCacheService.cs.
fix: 缓存管理,如果缓存键包含编码过的无法读取到

Signed-off-by: xin12023 <chenxin2024@gmail.com>

xin12023 há 2 anos atrás
pai
commit
153e7e2dd1

+ 4 - 0
Admin.NET/Admin.NET.Core/Service/Cache/SysCacheService.cs

@@ -133,6 +133,10 @@ public class SysCacheService : IDynamicApiController, ISingleton
     [DisplayName("获取缓存值")]
     public object GetValue(string key)
     {
+        if (key.Contains('%'))
+        {
+            key = HttpUtility.UrlDecode(key);
+        }
         return _cacheProvider.Cache == Cache.Default
             ? _cacheProvider.Cache.Get<object>($"{_cacheOptions.Prefix}{key}")
             : _cacheProvider.Cache.Get<string>($"{_cacheOptions.Prefix}{key}");