|
|
|
@@ -2,9 +2,6 @@ package com.iformall.interceptor; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import org.apache.shiro.SecurityUtils; |
|
|
|
import org.apache.shiro.session.Session; |
|
|
|
import org.apache.shiro.subject.Subject; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.web.method.HandlerMethod; |
|
|
|
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; |
|
|
|
@@ -24,14 +21,8 @@ public class CurrentTenantInterceptor extends HandlerInterceptorAdapter { |
|
|
|
@Override |
|
|
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
|
|
|
|
|
|
|
Subject s = SecurityUtils.getSubject(); |
|
|
|
if (null != s ) { |
|
|
|
Session session = s.getSession(); |
|
|
|
if (null != session ) { |
|
|
|
TenantThreadLocal.setCurrentThreadTenant((String)session.getAttribute(UserSession.tenantId), |
|
|
|
(String)session.getAttribute(UserSession.parentTenantId)); |
|
|
|
} |
|
|
|
} |
|
|
|
TenantThreadLocal.setCurrentThreadTenant((String)request.getSession().getAttribute(UserSession.tenantId), |
|
|
|
(String)request.getSession().getAttribute(UserSession.parentTenantId)); |
|
|
|
|
|
|
|
TenantIgnore annotation = null; |
|
|
|
if(handler instanceof HandlerMethod) { |
|
|
|
|