@ResponseBody @RequestMapping("/update") public String update(@ModelAttribute("role") Role role, HttpServletRequest request) { // 从session取出User对象 User user = SessionUtil.getSessionUser(request); // 生成节点角色 roleService.updateRoleById(role, user); return ConstantUtil.Success; }
@ResponseBody @RequestMapping("/add") public String add(@ModelAttribute("role") Role role, HttpServletRequest request) { // 从session取出User对象 User user = SessionUtil.getSessionUser(request); // 生成节点角色 if (role.getRemark() == null) { role.setRemark(""); } roleService.createRole(role, user); return ConstantUtil.Success; }
@RequestMapping("/list") public String main( String visitedModule, String visitedResource, HttpServletRequest request, ModelMap map) { // 初始化用户、菜单 User user = SessionUtil.getSessionUser(request); String menus = privilegeBaseApiService.getModuleTree(user.getId(), visitedModule, visitedResource); map.put("user", user); map.put("menus", menus); return "role/list.ftl"; }