This commit is contained in:
parent
07b55f8508
commit
4f5661bff3
|
|
@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -24,6 +25,9 @@ public class CorsFilter implements Filter {
|
|||
throws IOException, ServletException {
|
||||
// traceId
|
||||
Map<String, String> copyOfContextMap = MDC.getCopyOfContextMap();
|
||||
if(copyOfContextMap == null){
|
||||
copyOfContextMap = new HashMap<>();
|
||||
}
|
||||
copyOfContextMap.put("traceId",applicationName + IdUtil.getSnowflakeNextId());
|
||||
MDC.setContextMap(copyOfContextMap);
|
||||
HttpServletResponse response = (HttpServletResponse) resp;
|
||||
|
|
|
|||
Loading…
Reference in New Issue