| | |
| | | package com.se.system.controller; |
| | | |
| | | import com.se.common.core.utils.StringUtils; |
| | | import com.se.common.core.utils.ip.IpUtils; |
| | | import com.se.common.core.web.controller.BaseController; |
| | | import com.se.common.core.web.domain.AjaxResult; |
| | |
| | | import com.se.system.api.domain.SysLogininfor; |
| | | import com.se.system.api.domain.SysOperLog; |
| | | import com.se.system.api.model.LoginUser; |
| | | import com.se.system.domain.SysMenu; |
| | | import com.se.system.service.IndexService; |
| | | import com.se.system.service.impl.SysMenuServiceImpl; |
| | | import com.se.system.service.inte.ISysLogininforService; |
| | | import com.se.system.service.inte.ISysOperLogService; |
| | | import org.omg.PortableInterceptor.SYSTEM_EXCEPTION; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | IndexService indexService; |
| | | |
| | | @Resource |
| | | SysMenuServiceImpl menuService; |
| | | |
| | | @Resource |
| | | ISysOperLogService operLogService; |
| | | |
| | | @Resource |
| | | ISysLogininforService logininforService; |
| | | |
| | | private SysMenu sysMenu = new SysMenu(); |
| | | |
| | | public IndexController() { |
| | | sysMenu.setMark("index"); |
| | | } |
| | | |
| | | // ①PV统计:PV(Page View):页面浏览量或点击量,即网站所有页面被访问的总次数。 |
| | | // 每打开或刷新一个页面,PV就会增加一次,多次打开或刷新同一页面则浏览量累计。 |
| | |
| | | return map; |
| | | } |
| | | |
| | | @GetMapping("/getAllPerms") |
| | | public AjaxResult getAllPerms() { |
| | | try { |
| | | List<SysMenu> menus = menuService.selectMenuList(sysMenu, 1L); |
| | | |
| | | return success(menuService.buildMenus(menus)); |
| | | } catch (Exception ex) { |
| | | logger.error(ex.getMessage(), ex); |
| | | return error(ex.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/getMyPerms") |
| | | public AjaxResult getMyPerms() { |
| | | try { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectMenuList(sysMenu, userId); |
| | | |
| | | return success(menuService.buildMenus(menus)); |
| | | } catch (Exception ex) { |
| | | logger.error(ex.getMessage(), ex); |
| | | return error(ex.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/addAccessLog") |
| | | public AjaxResult addAccessLog(String title, int status) { |
| | | long start = System.currentTimeMillis(); |