Skip to content

Commit

Permalink
解决编辑菜单失败的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
stylefeng committed May 31, 2017
1 parent 00fe6c5 commit 82d1ec0
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,13 @@ public String menuEdit(@PathVariable Integer menuId, Model model) {
temp.setCode(menu.getPcode());
Menu pMenu = this.menuMapper.selectOne(temp);

//设置父级菜单的code为父级菜单的id
menu.setPcode(String.valueOf(pMenu.getId()));
//如果父级是顶级菜单
if(pMenu == null){
menu.setPcode("0");
}else{
//设置父级菜单的code为父级菜单的id
menu.setPcode(String.valueOf(pMenu.getId()));
}

Map<String, Object> menuMap = BeanKit.beanToMap(menu);
menuMap.put("pcodeName",ConstantFactory.me().getMenuNameByCode(temp.getCode()));
Expand Down

0 comments on commit 82d1ec0

Please sign in to comment.