Browse Source

更新权限

master
赵新宇 3 weeks ago
parent
commit
54bc505e00
  1. 5
      API/Wood.Service/Controllers/CheryRecurringJobInputPageExtendController.cs
  2. 9
      API/Wood.Service/SystemManage/RoleService.cs

5
API/Wood.Service/Controllers/CheryRecurringJobInputPageExtendController.cs

@ -573,12 +573,7 @@ namespace TaskManager.Controllers
SortBy = input.sortBy, SortBy = input.sortBy,
IsAscending = input.isAscending, IsAscending = input.isAscending,
}; };
var json = JsonSerializer.Serialize(input); var json = JsonSerializer.Serialize(input);
// 可以在这里构建表达式树过滤条件 // 可以在这里构建表达式树过滤条件
Expression<Func<T, bool>> filter = null; Expression<Func<T, bool>> filter = null;

9
API/Wood.Service/SystemManage/RoleService.cs

@ -81,10 +81,15 @@ namespace Wood.Service.SystemManage
public async Task Add(RoleAddParam entity) public async Task Add(RoleAddParam entity)
{ {
await _roleRepository.InsertAsync(entity.Adapt<RoleEntity>()); await _roleRepository.InsertAsync(entity.Adapt<RoleEntity>());
//var firstEntity=await _roleRepository.GetFirstAsync(p => p.RoleName == entity.RoleName); //var firstEntity=await _roleRepository.GetFirstAsync(p => p.RoleName == entity.RoleName);
var getentity=await _roleRepository.GetFirstAsync(p => p.RoleName == entity.RoleName);
await _menuAuthorizeRepository.InsertRangeAsync( await _menuAuthorizeRepository.InsertRangeAsync(
entity.Menus.Select(it => new MenuAuthorizeEntity() { RoleId = entity.Id, MenuId = it }).ToList() entity.Menus.Select(it => new MenuAuthorizeEntity() { RoleId = getentity.Id, MenuId = it }).ToList()
); );
} }

Loading…
Cancel
Save