/** * show manager home page * * @param first * @param second * @param user * @return */ @RequestMapping(value = "{first}/{second}", method = RequestMethod.GET) public String index(@PathVariable String first, @PathVariable String second, ModelMap model) { if (null == second || "".equals(second)) sendNotFoundError(); User user = (User) model.get(TOKEN); Menu activeMenu = roleMenuMapper.getMenuByRoleAndUrl(user.getRole_id(), first + "/" + second); if (null == activeMenu) sendNotFoundError(); // 跳转到视图 String view = "redirect:" + getManageRoot() + activeMenu.getMenuurl() + "/" + DEFAULT_VIEW; return view; }
/** * show manage home page * * @param menu_L2 二级菜单 * @param model * @return */ @RequestMapping(value = "{menu_L2}", method = RequestMethod.GET) public String index(@PathVariable String menu_L2, ModelMap model) { User user = (User) model.get(TOKEN); // 获取二级目录 Menu secondMenu = roleMenuMapper.getMenuByRoleAndUrl(user.getRole_id(), menu_L2); if (null == secondMenu) sendNotFoundError(); // 获取三级目录 Menu activeMenu = roleMenuMapper.getDefaultChild(secondMenu.getMenu_id(), user.getRole_id()); if (null == activeMenu) sendNotFoundError(); // 跳转到视图 String view = "redirect:" + getManageRoot() + activeMenu.getMenuurl() + "/" + DEFAULT_VIEW; return view; }