Commit 00a6afef124f0119d4f369a6e6cb45262ac3479f
1 parent
94bd74c2
update...
Showing
3 changed files
with
27 additions
and
4 deletions
src/main/java/com/bsth/controller/realcontrol/PageForwardingController.java
| 1 | 1 | package com.bsth.controller.realcontrol; |
| 2 | 2 | |
| 3 | +import com.bsth.entity.sys.Role; | |
| 3 | 4 | import com.bsth.entity.sys.SysUser; |
| 4 | 5 | import com.bsth.security.util.SecurityUtils; |
| 6 | +import org.slf4j.Logger; | |
| 7 | +import org.slf4j.LoggerFactory; | |
| 5 | 8 | import org.springframework.stereotype.Controller; |
| 6 | 9 | import org.springframework.web.bind.annotation.RequestMapping; |
| 7 | 10 | import org.springframework.web.servlet.ModelAndView; |
| 8 | 11 | |
| 12 | +import javax.servlet.http.HttpServletResponse; | |
| 13 | + | |
| 9 | 14 | /** |
| 10 | 15 | * 线调登入页面转发 |
| 11 | 16 | * Created by panzhao on 2017/1/21. |
| ... | ... | @@ -14,18 +19,36 @@ import org.springframework.web.servlet.ModelAndView; |
| 14 | 19 | @RequestMapping("real_control") |
| 15 | 20 | public class PageForwardingController { |
| 16 | 21 | |
| 22 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 23 | + | |
| 17 | 24 | @RequestMapping("/v2") |
| 18 | - public ModelAndView v2(){ | |
| 25 | + public ModelAndView v2(HttpServletResponse response){ | |
| 19 | 26 | ModelAndView mv = new ModelAndView(); |
| 20 | 27 | SysUser user = SecurityUtils.getCurrentUser(); |
| 21 | 28 | |
| 22 | 29 | //班次管理员 |
| 23 | 30 | if(user.getUserName().equals("bcgly")){ |
| 24 | 31 | mv.setViewName("/real_control_v2/sch_manage/sch_imitate.html"); |
| 32 | + return mv; | |
| 25 | 33 | } |
| 34 | + | |
| 35 | + try{ | |
| 36 | + //闵行运管所,直接打开地图页面 | |
| 37 | + if(user.getRoles().size() == 1){ | |
| 38 | + for(Role role : user.getRoles()){ | |
| 39 | + if(role.getCodeName().equals("MH_YGS")){ | |
| 40 | + // 直接重定向 | |
| 41 | + response.sendRedirect("/pages/mapmonitor/alone/wrap.html"); | |
| 42 | + return null; | |
| 43 | + } | |
| 44 | + } | |
| 45 | + } | |
| 46 | + }catch (Exception e){ | |
| 47 | + logger.error("", e); | |
| 48 | + } | |
| 49 | + | |
| 26 | 50 | //正常线调主页 |
| 27 | - else | |
| 28 | - mv.setViewName("/real_control_v2/main.html"); | |
| 51 | + mv.setViewName("/real_control_v2/main.html"); | |
| 29 | 52 | return mv; |
| 30 | 53 | } |
| 31 | 54 | } | ... | ... |
src/main/java/com/bsth/entity/sys/RealControAuthority.java
src/main/java/com/bsth/filter/ResourceFilter.java