update 去除了开发模式下的缓存
This commit is contained in:
@@ -35,7 +35,10 @@ namespace Ewide.Core.Service.Area
|
||||
CheckCode(input);
|
||||
CheckArea(input);
|
||||
await _areaCodeRep.InsertNowAsync(input.Adapt<SysAreaCode>());
|
||||
#if DEBUG
|
||||
#else
|
||||
await _sysCacheService.SetAreaCode(await _areaCodeRep.DetachedEntities.ToListAsync());
|
||||
#endif
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除一个区域
|
||||
@@ -50,7 +53,10 @@ namespace Ewide.Core.Service.Area
|
||||
throw Oops.Oh("不能删除已包含区域的组织");
|
||||
}
|
||||
await AreaCode.DeleteNowAsync();
|
||||
#if DEBUG
|
||||
#else
|
||||
await _sysCacheService.SetAreaCode(await _areaCodeRep.DetachedEntities.ToListAsync());
|
||||
#endif
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据区域代码获取区域信息
|
||||
@@ -63,7 +69,10 @@ namespace Ewide.Core.Service.Area
|
||||
if (cachedAreaCodes == null || cachedAreaCodes.Count < 0)
|
||||
{
|
||||
cachedAreaCodes = await _areaCodeRep.DetachedEntities.ToListAsync();
|
||||
#if DEBUG
|
||||
#else
|
||||
await _sysCacheService.SetAreaCode(cachedAreaCodes);
|
||||
#endif
|
||||
}
|
||||
return cachedAreaCodes.FirstOrDefault(a => a.Code == code);
|
||||
}
|
||||
@@ -78,7 +87,10 @@ namespace Ewide.Core.Service.Area
|
||||
if (cachedAreaCodes == null || cachedAreaCodes.Count < 0)
|
||||
{
|
||||
cachedAreaCodes = await _areaCodeRep.DetachedEntities.ToListAsync();
|
||||
#if DEBUG
|
||||
#else
|
||||
await _sysCacheService.SetAreaCode(cachedAreaCodes);
|
||||
#endif
|
||||
}
|
||||
cachedAreaCodes = cachedAreaCodes.Where(p => p.LevelType <= level).ToList();
|
||||
return new TreeBuildUtil<AreaTreeNode>().DoTreeBuild(cachedAreaCodes.Select(u => new AreaTreeNode
|
||||
@@ -120,7 +132,10 @@ namespace Ewide.Core.Service.Area
|
||||
CheckArea(input);
|
||||
var area = input.Adapt<SysAreaCode>();
|
||||
await area.UpdateNowAsync();
|
||||
#if DEBUG
|
||||
#else
|
||||
await _sysCacheService.SetAreaCode(await _areaCodeRep.DetachedEntities.ToListAsync());
|
||||
#endif
|
||||
}
|
||||
private bool CheckInput(AreaCodeInput input)
|
||||
{
|
||||
|
||||
@@ -129,7 +129,10 @@ namespace Ewide.Core.Service
|
||||
{
|
||||
var config = await _sysConfigRep.DetachedEntities.FirstOrDefaultAsync(u => u.Code == code);
|
||||
value = config != null ? config.Value : "";
|
||||
#if DEBUG
|
||||
#else
|
||||
await _sysCacheService.SetAsync(code, value);
|
||||
#endif
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@@ -142,7 +145,10 @@ namespace Ewide.Core.Service
|
||||
/// <returns></returns>
|
||||
public async Task UpdateConfigCache(string code, object value)
|
||||
{
|
||||
#if DEBUG
|
||||
#else
|
||||
await _sysCacheService.SetAsync(code, value);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -56,7 +56,10 @@ namespace Ewide.Core.Service
|
||||
.Where(u => u.Type == (int)MenuType.BTN)
|
||||
.Where(u => u.Status == (int)CommonStatus.ENABLE)
|
||||
.Select(u => u.Permission).ToListAsync();
|
||||
#if DEBUG
|
||||
#else
|
||||
await _sysCacheService.SetPermission(userId, permissions); // 缓存结果
|
||||
#endif
|
||||
}
|
||||
return permissions;
|
||||
}
|
||||
|
||||
@@ -90,9 +90,12 @@ namespace Ewide.Core.Service
|
||||
var parentAndChildIdListWithSelf = sysOrg.Pids.TrimEnd(',').Replace("[", "").Replace("]", "")
|
||||
.Split(",").ToList();
|
||||
dataScopeList.AddRange(parentAndChildIdListWithSelf);
|
||||
|
||||
// 添加本级(不知道为什么框架在这里排除了本级)
|
||||
dataScopeList.Add(u);
|
||||
});
|
||||
}
|
||||
return dataScopeList;
|
||||
return dataScopeList.Distinct().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -395,7 +395,10 @@ namespace Ewide.Core.Service
|
||||
|
||||
dataScopes = userDataScopeIdListForUser.Concat(userDataScopeIdListForRole).Distinct().ToList(); // 并集
|
||||
|
||||
#if DEBUG
|
||||
#else
|
||||
await _sysCacheService.SetDataScope(userId, dataScopes); // 缓存结果
|
||||
#endif
|
||||
}
|
||||
return dataScopes;
|
||||
}
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
"getLoginUser",
|
||||
"logout",
|
||||
"sysDictType:dropDown",
|
||||
"sysDictType:dropDowns",
|
||||
"sysFileInfo:upload",
|
||||
"sysFileInfo:download",
|
||||
"sysFileInfo:preview",
|
||||
|
||||
Reference in New Issue
Block a user