Compare commits

...
1 Commits
Author SHA1 Message Date
xrain 106d3eec19 fix cache 2026-04-27 00:04:29 +08:00
+2 -1
View File
@@ -15,6 +15,7 @@ public class SimApiCache(IDistributedCache cache)
/// <param name="options"></param>
public void Set(string key, object value, DistributedCacheEntryOptions? options = null)
{
SimApiError.ErrorWhenNull(value, 400, "缓存值不能为null");
if (options is not null)
{
cache.SetString(Prefix + key, SimApiUtil.Json(value), options);
@@ -51,7 +52,7 @@ public class SimApiCache(IDistributedCache cache)
/// <returns></returns>
public string? Get(string key)
{
return cache.GetString(Prefix + key);
return Get<string>(Prefix + key);
}
/// <summary>