增加数据权限

This commit is contained in:
不做码农
2022-01-22 20:47:48 +08:00
parent f5f5000854
commit bf26823a85
10 changed files with 275 additions and 118 deletions

View File

@@ -3,6 +3,7 @@ using Infrastructure.Attribute;
using Infrastructure.Enums;
using Microsoft.AspNetCore.Mvc;
using System.Collections;
using ZR.Admin.WebApi.Extensions;
using ZR.Admin.WebApi.Filters;
using ZR.Common;
using ZR.Model.System;
@@ -73,6 +74,24 @@ namespace ZR.Admin.WebApi.Controllers.System
return SUCCESS(DeptService.BuildDeptTreeSelect(depts), TIME_FORMAT_FULL);
}
/// <summary>
/// 获取角色部门信息
/// 加载对应角色部门列表树
/// </summary>
/// <param name="roleId"></param>
/// <returns></returns>
[HttpGet("roleDeptTreeselect/{roleId}")]
public IActionResult RoleMenuTreeselect(int roleId)
{
var depts = DeptService.GetSysDepts(new SysDept());
var checkedKeys = DeptService.SelectRoleDepts(roleId);
return SUCCESS(new
{
checkedKeys,
depts = DeptService.BuildDeptTreeSelect(depts),
});
}
/// <summary>
/// 根据部门编号获取详细信息
/// </summary>