Browse Source

fix bug

release_toaliyun_real
xiaohanzi 5 years ago
parent
commit
0e169f8687
1 changed files with 2 additions and 11 deletions
  1. +2
    -11
      mallinkAdmin/src/main/java/com/iformall/interceptor/CurrentTenantInterceptor.java

+ 2
- 11
mallinkAdmin/src/main/java/com/iformall/interceptor/CurrentTenantInterceptor.java View File

@@ -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) {


Loading…
Cancel
Save