diff --git a/mallchat-custom-server/src/main/java/com/abin/mallchat/custom/common/intecepter/TokenInterceptor.java b/mallchat-custom-server/src/main/java/com/abin/mallchat/custom/common/intecepter/TokenInterceptor.java index 719fb0d..814297b 100644 --- a/mallchat-custom-server/src/main/java/com/abin/mallchat/custom/common/intecepter/TokenInterceptor.java +++ b/mallchat-custom-server/src/main/java/com/abin/mallchat/custom/common/intecepter/TokenInterceptor.java @@ -45,6 +45,11 @@ public class TokenInterceptor implements HandlerInterceptor { return true; } + @Override + public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { + MDC.remove(MDCKey.UID); + } + /** * 判断是不是公共方法,可以未登录访问的 *