From 6fa176c3a6c5622c5a0a748d013876f4041c6712 Mon Sep 17 00:00:00 2001 From: qi_liang Date: Fri, 22 Mar 2019 09:03:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95shiro=20session=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E6=97=B6=E9=97=B4=E8=BF=87=E7=9F=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/lq/cms/web/IndexController.java | 6 +++++- src/main/resources/spring/spring-shiro.xml | 8 ++++---- src/main/webapp/WEB-INF/views/jsp/cms/sys/user/index.jsp | 5 ++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/lq/cms/web/IndexController.java b/src/main/java/com/lq/cms/web/IndexController.java index d8e70dd..e201493 100755 --- a/src/main/java/com/lq/cms/web/IndexController.java +++ b/src/main/java/com/lq/cms/web/IndexController.java @@ -43,7 +43,7 @@ import java.util.HashMap; @RequestMapping("/cms") public class IndexController { - private static Logger logger = Logger.getLogger(IndexController.class); + private static Logger LOGGER = Logger.getLogger(IndexController.class); @Autowired private SysResourceService sysResourceService; @@ -53,6 +53,10 @@ public class IndexController { @RequestMapping(value = {"/index",""}) public ModelAndView toCmsIndix(ModelAndView modelAndView, HttpServletRequest request){ Subject subject=SecurityUtils.getSubject(); + Session session = subject.getSession(); +LOGGER.info("==================="); +LOGGER.info("sessionID:"+session.getId()); +LOGGER.info("sessionTimeOut:"+session.getTimeout()); SysUser sysUser=(SysUser) subject.getPrincipal(); List list = null; if (subject.hasRole("admin")) { diff --git a/src/main/resources/spring/spring-shiro.xml b/src/main/resources/spring/spring-shiro.xml index eb61a11..e3ed143 100644 --- a/src/main/resources/spring/spring-shiro.xml +++ b/src/main/resources/spring/spring-shiro.xml @@ -29,7 +29,7 @@ - + @@ -49,13 +49,13 @@ class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager"> - + - + - + diff --git a/src/main/webapp/WEB-INF/views/jsp/cms/sys/user/index.jsp b/src/main/webapp/WEB-INF/views/jsp/cms/sys/user/index.jsp index bc91b2e..ea574e1 100755 --- a/src/main/webapp/WEB-INF/views/jsp/cms/sys/user/index.jsp +++ b/src/main/webapp/WEB-INF/views/jsp/cms/sys/user/index.jsp @@ -33,7 +33,8 @@ {field:'lastLoginTimeStr',title:'最后登录时间',width:150}, {field:'email',title:'电子邮件',width:150}, {field:'imgUrl',title:'头像',width:50,formatter:function(value,row,index){ - return ""; + var html = ''; + return html; }}, /* formatter 不能重复field,否则会失效**/ {field:'editId',title:'编辑',width:100,formatter:function (value,row,index) { @@ -50,6 +51,7 @@ handler: function(){openEdit('新增',null)} }] }); + }); @@ -59,6 +61,7 @@