feature:菜单添加unbindParent属性支持不关联上级菜单

This commit is contained in:
2021-04-26 11:37:52 +08:00
parent f6258537c2
commit 19aeb3b202
3 changed files with 16 additions and 0 deletions

View File

@@ -86,6 +86,11 @@ namespace Ewide.Core.Service
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 不绑定上级菜单
/// </summary>
public int UnbindParent { get; set; }
}
public class AddMenuInput : MenuInput

View File

@@ -182,6 +182,7 @@ namespace Ewide.Core.Service
var router = input.Router;
var permission = input.Permission;
var openType = input.OpenType;
var isUnbindParent = input.UnbindParent==1;
if (type.Equals((int)MenuType.DIR))
{
@@ -207,6 +208,11 @@ namespace Ewide.Core.Service
//if (!urlSet.Contains(permission.Replace(":","/")))
// throw Oops.Oh(ErrorCode.meu1005);
}
//按钮可以设置未不绑定菜单
if(isUnbindParent && type.Equals((int)MenuType.BTN))
{
throw Oops.Oh(ErrorCode.D4004);
}
}
/// <summary>