| | |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | |
| | | private ResultUtil resultUtil; |
| | | |
| | | @Resource |
| | | private ShiroExtUtil shiroExtUtil; |
| | | |
| | | /** |
| | | * 跳转到黑板 |
| | | */ |
| | | @RequestMapping("") |
| | | public String blackboard(Model model,Integer type) { |
| | | //查询当前用户是否有"首页"菜单的权限 |
| | | Integer id = ShiroExtUtil.getUser().getId(); |
| | | Integer id = shiroExtUtil.getUser().getId(); |
| | | User user = userService.selectById(id); |
| | | Integer menuNum = userService.getMenuNumByRole(user.getRoleid()); |
| | | if (menuNum > 0){ |
| | | return "/home.html"; |
| | | } else { |
| | | //查询登录次数 |
| | | int count = loginLogService.selectCount(new EntityWrapper<LoginLog>().eq("userid", ShiroExtUtil.getUser().getId())); |
| | | int count = loginLogService.selectCount(new EntityWrapper<LoginLog>().eq("userid", shiroExtUtil.getUser().getId())); |
| | | model.addAttribute("loginNum", count); |
| | | |
| | | Role role = roleService.selectById(user.getRoleid()); |