菜单模块

This commit is contained in:
cwchen 2024-02-28 09:21:43 +08:00
parent f2d9c17648
commit 9e97575a54
1 changed files with 4 additions and 4 deletions

View File

@ -110,15 +110,15 @@ public class MenuServiceImpl implements MenuService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult addOrUpdateMenu(MenuVo vo) { public AjaxResult addOrUpdateMenu(MenuVo vo) {
try { try {
if(vo.getParentId() == null){
vo.setParentId(0);
}
int result = mapper.isMenuName(vo);
if(!Objects.equals(vo.getMenuType(),Constant.MENU_TYPE)){ if(!Objects.equals(vo.getMenuType(),Constant.MENU_TYPE)){
if(StringUtils.isBlank(vo.getMenuUrl())){ if(StringUtils.isBlank(vo.getMenuUrl())){
return AjaxResult.error("菜单地址不能为空"); return AjaxResult.error("菜单地址不能为空");
} }
} }
if(vo.getParentId() == null){
vo.setParentId(0);
}
int result = mapper.isMenuName(vo);
if (vo.getMenuId() == null) { if (vo.getMenuId() == null) {
vo.setType(1); vo.setType(1);
vo.setCreateTime(DateTimeHelper.getNowTime()); vo.setCreateTime(DateTimeHelper.getNowTime());