Example #1
0
  @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;
  }
Example #2
0
 @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;
 }
Example #3
0
  @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";
  }