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 | package com.bsth.controller.realcontrol; | 1 | package com.bsth.controller.realcontrol; |
| 2 | 2 | ||
| 3 | +import com.bsth.entity.sys.Role; | ||
| 3 | import com.bsth.entity.sys.SysUser; | 4 | import com.bsth.entity.sys.SysUser; |
| 4 | import com.bsth.security.util.SecurityUtils; | 5 | import com.bsth.security.util.SecurityUtils; |
| 6 | +import org.slf4j.Logger; | ||
| 7 | +import org.slf4j.LoggerFactory; | ||
| 5 | import org.springframework.stereotype.Controller; | 8 | import org.springframework.stereotype.Controller; |
| 6 | import org.springframework.web.bind.annotation.RequestMapping; | 9 | import org.springframework.web.bind.annotation.RequestMapping; |
| 7 | import org.springframework.web.servlet.ModelAndView; | 10 | import org.springframework.web.servlet.ModelAndView; |
| 8 | 11 | ||
| 12 | +import javax.servlet.http.HttpServletResponse; | ||
| 13 | + | ||
| 9 | /** | 14 | /** |
| 10 | * 线调登入页面转发 | 15 | * 线调登入页面转发 |
| 11 | * Created by panzhao on 2017/1/21. | 16 | * Created by panzhao on 2017/1/21. |
| @@ -14,18 +19,36 @@ import org.springframework.web.servlet.ModelAndView; | @@ -14,18 +19,36 @@ import org.springframework.web.servlet.ModelAndView; | ||
| 14 | @RequestMapping("real_control") | 19 | @RequestMapping("real_control") |
| 15 | public class PageForwardingController { | 20 | public class PageForwardingController { |
| 16 | 21 | ||
| 22 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 23 | + | ||
| 17 | @RequestMapping("/v2") | 24 | @RequestMapping("/v2") |
| 18 | - public ModelAndView v2(){ | 25 | + public ModelAndView v2(HttpServletResponse response){ |
| 19 | ModelAndView mv = new ModelAndView(); | 26 | ModelAndView mv = new ModelAndView(); |
| 20 | SysUser user = SecurityUtils.getCurrentUser(); | 27 | SysUser user = SecurityUtils.getCurrentUser(); |
| 21 | 28 | ||
| 22 | //班次管理员 | 29 | //班次管理员 |
| 23 | if(user.getUserName().equals("bcgly")){ | 30 | if(user.getUserName().equals("bcgly")){ |
| 24 | mv.setViewName("/real_control_v2/sch_manage/sch_imitate.html"); | 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 | return mv; | 52 | return mv; |
| 30 | } | 53 | } |
| 31 | } | 54 | } |
src/main/java/com/bsth/entity/sys/RealControAuthority.java
src/main/java/com/bsth/filter/ResourceFilter.java
| @@ -42,7 +42,6 @@ public class ResourceFilter extends BaseFilter { | @@ -42,7 +42,6 @@ public class ResourceFilter extends BaseFilter { | ||
| 42 | 42 | ||
| 43 | if (f.exists() && f.isFile()) { | 43 | if (f.exists() && f.isFile()) { |
| 44 | request.getRequestDispatcher("/?initFragment=" + joinParam(request)).forward(request, response); | 44 | request.getRequestDispatcher("/?initFragment=" + joinParam(request)).forward(request, response); |
| 45 | - ; | ||
| 46 | } else | 45 | } else |
| 47 | response.sendRedirect("/"); | 46 | response.sendRedirect("/"); |
| 48 | } | 47 | } |