Ver a proveniência

fix bug

release_toaliyun_real
xiaohanzi há 6 anos
ascendente
cometimento
0e169f8687
1 ficheiros alterados com 2 adições e 11 eliminações
  1. +2
    -11
      mallinkAdmin/src/main/java/com/iformall/interceptor/CurrentTenantInterceptor.java

+ 2
- 11
mallinkAdmin/src/main/java/com/iformall/interceptor/CurrentTenantInterceptor.java Ver ficheiro

@@ -2,9 +2,6 @@ package com.iformall.interceptor;


import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; 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.stereotype.Component;
import org.springframework.web.method.HandlerMethod; import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
@@ -24,14 +21,8 @@ public class CurrentTenantInterceptor extends HandlerInterceptorAdapter {
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 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; TenantIgnore annotation = null;
if(handler instanceof HandlerMethod) { if(handler instanceof HandlerMethod) {


Carregando…
Cancelar
Guardar