Browse Source
Merge pull request #1282 from colinin/fix-menu-parent
fix(platform): Fix the same menu error
pull/1284/head
yx lin
8 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
14 additions and
1 deletions
-
aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Menus/MenuAppService.cs
-
aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/en.json
-
aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/zh-Hans.json
-
aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/PlatformErrorCodes.cs
|
|
@ -210,8 +210,15 @@ public class MenuAppService : PlatformApplicationServiceBase, IMenuAppService |
|
|
{ |
|
|
{ |
|
|
menu.Component = input.Component; |
|
|
menu.Component = input.Component; |
|
|
} |
|
|
} |
|
|
|
|
|
if (menu.ParentId != input.ParentId) |
|
|
|
|
|
{ |
|
|
|
|
|
if (input.ParentId == menu.Id) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new BusinessException(PlatformErrorCodes.CannotSetSelfParentMenu, "The current menu cannot be the same as the upper-level menu!"); |
|
|
|
|
|
} |
|
|
|
|
|
menu.ParentId = input.ParentId; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
menu.ParentId = input.ParentId; |
|
|
|
|
|
menu.IsPublic = input.IsPublic; |
|
|
menu.IsPublic = input.IsPublic; |
|
|
|
|
|
|
|
|
await MenuManager.UpdateAsync(menu); |
|
|
await MenuManager.UpdateAsync(menu); |
|
|
|
|
|
@ -6,6 +6,7 @@ |
|
|
"Platform:02001": "The same menu exists in the sibling directory: {Name}!", |
|
|
"Platform:02001": "The same menu exists in the sibling directory: {Name}!", |
|
|
"Platform:02002": "You are not allowed to delete menu nodes when there are other submenus!", |
|
|
"Platform:02002": "You are not allowed to delete menu nodes when there are other submenus!", |
|
|
"Platform:02003": "The menu level has reached the specified maximum: {Depth}!", |
|
|
"Platform:02003": "The menu level has reached the specified maximum: {Depth}!", |
|
|
|
|
|
"Platform:02004": "The current menu cannot be the same as the upper-level menu!", |
|
|
"Platform:02101": "The menu metadata is missing the necessary element :{Name}, which is defined in the data dictionary :{DataName}!", |
|
|
"Platform:02101": "The menu metadata is missing the necessary element :{Name}, which is defined in the data dictionary :{DataName}!", |
|
|
"Platform:03001": "The metadata format does not match!", |
|
|
"Platform:03001": "The metadata format does not match!", |
|
|
"Platform:04400": "The user favorites the menu repeatedly!", |
|
|
"Platform:04400": "The user favorites the menu repeatedly!", |
|
|
|
|
|
@ -6,6 +6,7 @@ |
|
|
"Platform:02001": "同级目录下存在相同的菜单: {Name}!", |
|
|
"Platform:02001": "同级目录下存在相同的菜单: {Name}!", |
|
|
"Platform:02002": "在有其他子菜单的情况下,不允许删除菜单节点!", |
|
|
"Platform:02002": "在有其他子菜单的情况下,不允许删除菜单节点!", |
|
|
"Platform:02003": "菜单层级已达到规定最大值: {Depth}!", |
|
|
"Platform:02003": "菜单层级已达到规定最大值: {Depth}!", |
|
|
|
|
|
"Platform:02004": "当前菜单不能与上级菜单相同!", |
|
|
"Platform:02101": "菜单元数据缺少必要的元素: {Name},此选项在数据字典:{DataName} 中定义!", |
|
|
"Platform:02101": "菜单元数据缺少必要的元素: {Name},此选项在数据字典:{DataName} 中定义!", |
|
|
"Platform:03001": "元数据格式不匹配!", |
|
|
"Platform:03001": "元数据格式不匹配!", |
|
|
"Platform:04400": "用户重复收藏菜单!", |
|
|
"Platform:04400": "用户重复收藏菜单!", |
|
|
|
|
|
@ -22,6 +22,10 @@ public static class PlatformErrorCodes |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public const string MenuAchieveMaxDepth = Namespace + ":02003"; |
|
|
public const string MenuAchieveMaxDepth = Namespace + ":02003"; |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
|
|
|
/// 当前菜单不能与上级菜单相同
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public const string CannotSetSelfParentMenu = Namespace + ":02004"; |
|
|
|
|
|
/// <summary>
|
|
|
/// 菜单元数据缺少必要的元素
|
|
|
/// 菜单元数据缺少必要的元素
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public const string MenuMissingMetadata = Namespace + ":02101"; |
|
|
public const string MenuMissingMetadata = Namespace + ":02101"; |
|
|
|