同学,看这里:
@RequestMapping(value = "/list.do",method = RequestMethod.POST)
@ResponseBody
public ServerResponse list(@RequestParam(value = "pageNum",defaultValue = "1")int pageNum,@RequestParam(value = "pageSize",defaultValue = "5")int pageSize,HttpSession session){
User user = (User) session.getAttribute(Const.CURRENT_USER);
if(user==null) {
return ServerResponse.createByErrorByMessage("请登录后再试");
}
if(Const.Role.ROLE_ADMIN != user.getRole()) {
return ServerResponse.createByErrorByMessage("非管理员访问");
}
return iUserService.list(pageNum, pageSize);
}