提交 09f2d222 编写于 作者: J jay1991115@126.com

clean ThreadLocal

上级 564b7d64
......@@ -76,6 +76,12 @@ public class AccessInterceptor extends HandlerInterceptorAdapter{
return true;
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
super.afterCompletion(request, response, handler, ex);
UserContext.removeUser();
}
private void render(HttpServletResponse response, ResultStatus cm)throws Exception {
response.setContentType("application/json;charset=UTF-8");
OutputStream out = response.getOutputStream();
......
......@@ -14,4 +14,8 @@ public class UserContext {
return userHolder.get();
}
public static void removeUser() {
userHolder.remove();
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册