diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java index 99095166..cd1bf543 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/MenuServiceImpl.java @@ -171,6 +171,9 @@ public class MenuServiceImpl extends ServiceImpl implements IM @Override public boolean submit(Menu menu) { + if (menu.getParentId() == null && menu.getId() == null) { + menu.setParentId(BladeConstant.TOP_PARENT_ID); + } menu.setIsDeleted(BladeConstant.DB_NOT_DELETED); return saveOrUpdate(menu); }