|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.wcs.common.config; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.zy.asrs.wcs.common.constant.Constants; | 
|---|
|  |  |  | import com.zy.asrs.wcs.utils.Utils; | 
|---|
|  |  |  | import org.springframework.context.annotation.Bean; | 
|---|
|  |  |  | import org.springframework.context.annotation.Configuration; | 
|---|
|  |  |  | import org.springframework.web.servlet.AsyncHandlerInterceptor; | 
|---|
|  |  |  | import org.springframework.web.servlet.config.annotation.CorsRegistry; | 
|---|
|  |  |  | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; | 
|---|
|  |  |  | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void addCorsMappings(CorsRegistry registry) { | 
|---|
|  |  |  | registry.addMapping("/**") | 
|---|
|  |  |  | .allowedOriginPatterns("*") | 
|---|
|  |  |  | .allowedHeaders("*") | 
|---|
|  |  |  | .exposedHeaders(Constants.TOKEN_HEADER_NAME) | 
|---|
|  |  |  | .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH") | 
|---|
|  |  |  | .allowCredentials(true) | 
|---|
|  |  |  | .maxAge(3600); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|