| | |
| | | import com.vci.starter.web.annotation.controller.VciUnCheckRight; |
| | | import com.vci.starter.web.autoconfigure.SpringMVCConfig; |
| | | import com.vci.starter.web.constant.TokenKeyConstant; |
| | | import com.vci.starter.web.constant.VConstant; |
| | | import com.vci.starter.web.enumpck.ResultCodeEnum; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.SessionInfo; |
| | | import com.vci.starter.web.redis.RedisService; |
| | | import com.vci.starter.web.util.ApplicationContextProvider; |
| | | import com.vci.starter.web.util.LangBaseUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.AnnotationConfigApplicationContext; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.method.HandlerMethod; |
| | | import org.springframework.web.servlet.HandlerInterceptor; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | @Autowired |
| | | private VciSessionForLoginI vciSessionForLoginI; |
| | | |
| | | @Autowired |
| | | private RedisService redisService; |
| | | |
| | | /** |
| | | * 执行拦截 |
| | | * @param request 请求对象 |
| | |
| | | if(StringUtils.isBlank(userToken)){ |
| | | userToken = request.getParameter(TokenKeyConstant.USER_TOKEN_KEY); |
| | | } |
| | | if(!(handler instanceof HandlerMethod)){ |
| | | if(!(handler instanceof HandlerMethod)){ |
| | | return true; |
| | | } |
| | | |
| | |
| | | if(logger.isErrorEnabled()) { |
| | | logger.error("token值非法,或过期,或者用户已经被踢下线," + userToken); |
| | | } |
| | | //删除缓存中统计的用户信息 |
| | | if(redisService == null){ |
| | | redisService = ApplicationContextProvider.getBean(RedisService.class); |
| | | } |
| | | redisService.decreOnlineUser(VConstant.CURRENT_LOGGED_USERS_KEY); |
| | | sendErrorMsg(response,"token值非法,或过期,或者用户已经被踢下线," + userToken,1); |
| | | return false; |
| | | }else{ |