This commit is contained in:
@@ -8,12 +8,12 @@
|
||||
/// <summary>
|
||||
/// id
|
||||
/// </summary>
|
||||
public long? Id { get; set; }
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父id
|
||||
/// </summary>
|
||||
public long? Pid { get; set; }
|
||||
public string Pid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 路由名称, 必须设置,且不能重名
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Dilon.Core.Service
|
||||
/// <summary>
|
||||
/// 父Id
|
||||
/// </summary>
|
||||
public virtual long Pid { get; set; }
|
||||
public virtual string Pid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
@@ -103,7 +103,7 @@ namespace Dilon.Core.Service
|
||||
/// 菜单Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "菜单Id不能为空")]
|
||||
public long Id { get; set; }
|
||||
public string Id { get; set; }
|
||||
}
|
||||
|
||||
public class UpdateMenuInput : AddMenuInput
|
||||
@@ -112,13 +112,13 @@ namespace Dilon.Core.Service
|
||||
/// 菜单Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "菜单Id不能为空")]
|
||||
public long Id { get; set; }
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父Id
|
||||
/// </summary>DeleteMenuInput
|
||||
[Required(ErrorMessage = "父级菜单Id不能为空")]
|
||||
public override long Pid { get; set; }
|
||||
public override string Pid { get; set; }
|
||||
}
|
||||
|
||||
public class QueryMenuInput : DeleteMenuInput
|
||||
|
||||
@@ -11,19 +11,19 @@ namespace Dilon.Core.Service
|
||||
/// <summary>
|
||||
/// 菜单Id
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子节点
|
||||
/// </summary>
|
||||
public List<MenuOutput> Children { get; set; } = new List<MenuOutput>();
|
||||
|
||||
public long GetId()
|
||||
public string GetId()
|
||||
{
|
||||
return Id;
|
||||
}
|
||||
|
||||
public long GetPid()
|
||||
public string GetPid()
|
||||
{
|
||||
return Pid;
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace Dilon.Core.Service
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父Id
|
||||
/// </summary>
|
||||
public long ParentId { get; set; }
|
||||
public string ParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
@@ -38,12 +38,12 @@ namespace Dilon.Core.Service
|
||||
/// </summary>
|
||||
public List<MenuTreeOutput> Children { get; set; } = new List<MenuTreeOutput>();
|
||||
|
||||
public long GetId()
|
||||
public string GetId()
|
||||
{
|
||||
return Id;
|
||||
}
|
||||
|
||||
public long GetPid()
|
||||
public string GetPid()
|
||||
{
|
||||
return ParentId;
|
||||
}
|
||||
|
||||
@@ -9,12 +9,12 @@ namespace Dilon.Core.Service
|
||||
Task AddMenu(AddMenuInput input);
|
||||
Task<List<AntDesignTreeNode>> ChangeAppMenu(ChangeAppMenuInput input);
|
||||
Task DeleteMenu(DeleteMenuInput input);
|
||||
Task<List<AntDesignTreeNode>> GetLoginMenusAntDesign(long userId, string appCode);
|
||||
Task<List<string>> GetLoginPermissionList(long userId);
|
||||
Task<List<AntDesignTreeNode>> GetLoginMenusAntDesign(string userId, string appCode);
|
||||
Task<List<string>> GetLoginPermissionList(string userId);
|
||||
Task<dynamic> GetMenu(QueryMenuInput input);
|
||||
Task<dynamic> GetMenuList([FromQuery] MenuInput input);
|
||||
Task<dynamic> GetMenuTree([FromQuery] MenuInput input);
|
||||
Task<List<string>> GetUserMenuAppCodeList(long userId);
|
||||
Task<List<string>> GetUserMenuAppCodeList(string userId);
|
||||
Task<bool> HasMenu(string appCode);
|
||||
Task<dynamic> TreeForGrant([FromQuery] MenuInput input);
|
||||
Task UpdateMenu(UpdateMenuInput input);
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Dilon.Core.Service
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public async Task<List<string>> GetLoginPermissionList(long userId)
|
||||
public async Task<List<string>> GetLoginPermissionList(string userId)
|
||||
{
|
||||
var permissions = await _sysCacheService.GetPermission(userId); // 先从缓存里面读取
|
||||
if (permissions == null || permissions.Count < 1)
|
||||
@@ -68,7 +68,7 @@ namespace Dilon.Core.Service
|
||||
/// <param name="appCode"></param>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public async Task<List<AntDesignTreeNode>> GetLoginMenusAntDesign(long userId, string appCode)
|
||||
public async Task<List<AntDesignTreeNode>> GetLoginMenusAntDesign(string userId, string appCode)
|
||||
{
|
||||
var antDesignTreeNodes = await _sysCacheService.GetMenu(userId, appCode); // 先从缓存里面读取
|
||||
if (antDesignTreeNodes == null || antDesignTreeNodes.Count < 1)
|
||||
@@ -109,7 +109,7 @@ namespace Dilon.Core.Service
|
||||
{
|
||||
Title = u.Name,
|
||||
Icon = u.Icon,
|
||||
Show = u.Visible == YesOrNot.Y.ToString(),
|
||||
Show = u.Visible,
|
||||
Link = u.Link,
|
||||
Target = u.OpenType == (int)MenuOpenType.OUTER ? "_blank" : ""
|
||||
}
|
||||
@@ -125,7 +125,7 @@ namespace Dilon.Core.Service
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public async Task<List<string>> GetUserMenuAppCodeList(long userId)
|
||||
public async Task<List<string>> GetUserMenuAppCodeList(string userId)
|
||||
{
|
||||
var roleIdList = await _sysUserRoleService.GetUserRoleIdList(userId);
|
||||
var menuIdList = await _sysRoleMenuService.GetRoleMenuIdList(roleIdList);
|
||||
@@ -159,11 +159,11 @@ namespace Dilon.Core.Service
|
||||
/// </summary>
|
||||
/// <param name="pid"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<string> CreateNewPids(long pid)
|
||||
private async Task<string> CreateNewPids(string pid)
|
||||
{
|
||||
if (pid == 0L)
|
||||
if (pid.Equals(System.Guid.Empty.ToString()))
|
||||
{
|
||||
return "[0],";
|
||||
return "[" + System.Guid.Empty + "],";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -296,7 +296,7 @@ namespace Dilon.Core.Service
|
||||
if (input.Application != oldMenu.Application)
|
||||
{
|
||||
// 父节点不是根节点不能移动应用
|
||||
if (oldMenu.Pid != 0L)
|
||||
if (!oldMenu.Pid.Equals(System.Guid.Empty.ToString()))
|
||||
throw Oops.Oh(ErrorCode.D4007);
|
||||
updateSubAppsFlag = true;
|
||||
}
|
||||
@@ -389,7 +389,7 @@ namespace Dilon.Core.Service
|
||||
[HttpGet("/sysMenu/treeForGrant")]
|
||||
public async Task<dynamic> TreeForGrant([FromQuery] MenuInput input)
|
||||
{
|
||||
var menuIdList = new List<long>();
|
||||
var menuIdList = new List<string>();
|
||||
if (_userManager.SuperAdmin)
|
||||
{
|
||||
var roleIdList = await _sysUserRoleService.GetUserRoleIdList(_userManager.UserId);
|
||||
|
||||
Reference in New Issue
Block a user