From a78211ca00d0261349cd4e761e4ddb70aadd6469 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 10 Aug 2020 12:20:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8A=E7=BA=A7=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E4=B8=8D=E8=83=BD=E9=80=89=E6=8B=A9=E8=87=AA=E5=B7=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/web/controller/system/SysMenuController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java index 8bdfe91..e8ec380 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java @@ -128,6 +128,10 @@ public class SysMenuController extends BaseController { return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); } + else if (menu.getMenuId().equals(menu.getParentId())) + { + return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己"); + } menu.setUpdateBy(SecurityUtils.getUsername()); return toAjax(menuService.updateMenu(menu)); }