mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-22 03:24:29 +08:00
refactor: 调整模块顺序
This commit is contained in:
@@ -246,7 +246,7 @@ public class AuthService : IAuthService
|
||||
await UpdateUser(logingEvent).ConfigureAwait(false);
|
||||
if (sysUser.Account == RoleConst.SuperAdmin)
|
||||
{
|
||||
var modules = (await _sysResourceService.GetAllAsync().ConfigureAwait(false)).Where(a => a.Category == ResourceCategoryEnum.Module);//获取模块列表
|
||||
var modules = (await _sysResourceService.GetAllAsync().ConfigureAwait(false)).Where(a => a.Category == ResourceCategoryEnum.Module).OrderBy(a=>a.SortCode);//获取模块列表
|
||||
sysUser.ModuleList = modules.ToList();//模块列表赋值给用户
|
||||
}
|
||||
//返回结果
|
||||
|
@@ -901,13 +901,13 @@ internal sealed class SysUserService : BaseService<SysUser>, ISysUserService
|
||||
|
||||
if (sysUser.Account == RoleConst.SuperAdmin)
|
||||
{
|
||||
var modules = (await _sysResourceService.GetAllAsync().ConfigureAwait(false)).Where(a => a.Category == ResourceCategoryEnum.Module);
|
||||
var modules = (await _sysResourceService.GetAllAsync().ConfigureAwait(false)).Where(a => a.Category == ResourceCategoryEnum.Module).OrderBy(a=>a.SortCode);
|
||||
sysUser.ModuleList = modules.ToList();//模块列表赋值给用户
|
||||
}
|
||||
else
|
||||
{
|
||||
var moduleIds = await _relationService.GetUserModuleId(sysUser.RoleIdList, sysUser.Id).ConfigureAwait(false);//获取模块ID列表
|
||||
var modules = await _sysResourceService.GetMuduleByMuduleIdsAsync(moduleIds).ConfigureAwait(false);//获取模块列表
|
||||
var modules = (await _sysResourceService.GetMuduleByMuduleIdsAsync(moduleIds).ConfigureAwait(false)).OrderBy(a => a.SortCode);//获取模块列表
|
||||
sysUser.ModuleList = modules.ToList();//模块列表赋值给用户
|
||||
}
|
||||
|
||||
|
@@ -95,7 +95,8 @@ public class BlazorAppContext
|
||||
});
|
||||
}
|
||||
AllResource = sysResources;
|
||||
CurrentUser.ModuleList = AllResource.Where(a => CurrentUser.ModuleList.Select(a => a.Id).ToHashSet().Contains(a.Id)).ToList();
|
||||
var ids = CurrentUser.ModuleList.Select(a => a.Id).ToHashSet();
|
||||
CurrentUser.ModuleList = AllResource.Where(a => ids.Contains(a.Id)).OrderBy(a=>a.SortCode).ToList();
|
||||
AllMenus = sysResources.Where(a => a.Category == ResourceCategoryEnum.Menu);
|
||||
|
||||
if (moduleId == null)
|
||||
|
@@ -12,7 +12,7 @@
|
||||
"CreateTime": "2025-01-14 20:16:18.361",
|
||||
"CreateUserId": "0",
|
||||
"IsDelete": "0",
|
||||
"SortCode": "0"
|
||||
"SortCode": "-100"
|
||||
},
|
||||
{
|
||||
"Id": 61000012000,
|
||||
|
Reference in New Issue
Block a user