|
|
@ -162,18 +162,18 @@ public class SysDataUserMenuService : ISysDataUserMenu, IDynamicApiController, I
|
|
|
|
|
|
|
|
|
|
|
|
List<SysDataUserMenu> list = new List<SysDataUserMenu>();
|
|
|
|
List<SysDataUserMenu> list = new List<SysDataUserMenu>();
|
|
|
|
List<long> datascope = new List<long>();
|
|
|
|
List<long> datascope = new List<long>();
|
|
|
|
//if (_sysCache.Exists(CommonConst.CACHE_KEY_USERDATASCOPE))
|
|
|
|
if (_sysCache.Exists(CommonConst.CACHE_KEY_USERDATASCOPE))
|
|
|
|
//{
|
|
|
|
{
|
|
|
|
// list = await _sysCache.GetAsync<List<SysDataUserMenu>>(CommonConst.CACHE_KEY_USERDATASCOPE);
|
|
|
|
list = await _sysCache.GetAsync<List<SysDataUserMenu>>(CommonConst.CACHE_KEY_USERDATASCOPE);
|
|
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
//else
|
|
|
|
else
|
|
|
|
//{
|
|
|
|
{
|
|
|
|
// list = await _rep.AsQueryable().ToListAsync();
|
|
|
|
list = await _rep.AsQueryable().ToListAsync();
|
|
|
|
// _sysCache.Set(CommonConst.CACHE_KEY_USERDATASCOPE, list);
|
|
|
|
_sysCache.Set(CommonConst.CACHE_KEY_USERDATASCOPE, list);
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
list = await _rep.AsQueryable().ToListAsync();
|
|
|
|
//list = await _rep.AsQueryable().ToListAsync();
|
|
|
|
_sysCache.Set(CommonConst.CACHE_KEY_USERDATASCOPE, list);
|
|
|
|
//_sysCache.Set(CommonConst.CACHE_KEY_USERDATASCOPE, list);
|
|
|
|
DataScopeType _dataScopeType = list.Where(x => x.SysMenuId == menuid && x.SysUserId == UserManager.UserId).Select(x => x.DataScopeType).FirstOrDefault();
|
|
|
|
DataScopeType _dataScopeType = list.Where(x => x.SysMenuId == menuid && x.SysUserId == UserManager.UserId).Select(x => x.DataScopeType).FirstOrDefault();
|
|
|
|
if (_dataScopeType == DataScopeType.ALL)
|
|
|
|
if (_dataScopeType == DataScopeType.ALL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|