添加 JwtFilter中ThreadLocal需要及时清除
This commit is contained in:
+1
-1
@@ -73,7 +73,7 @@ public class JwtUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成签名,5min后过期
|
* 生成签名
|
||||||
*
|
*
|
||||||
* @param username 用户名
|
* @param username 用户名
|
||||||
* @param secret 用户的密码
|
* @param secret 用户的密码
|
||||||
|
|||||||
+14
@@ -99,4 +99,18 @@ public class JwtFilter extends BasicHttpAuthenticationFilter {
|
|||||||
//update-end-author:taoyan date:20200708 for:多租户用到
|
//update-end-author:taoyan date:20200708 for:多租户用到
|
||||||
return super.preHandle(request, response);
|
return super.preHandle(request, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JwtFilter中ThreadLocal需要及时清除 #3634
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @param exception
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void afterCompletion(ServletRequest request, ServletResponse response, Exception exception) throws Exception {
|
||||||
|
//log.info("------清空线程中多租户的ID={}------",TenantContext.getTenant());
|
||||||
|
TenantContext.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user