package com.chenyang.nse.bussiness.webtools.controller.core.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class WebToolsWebMvcConfig extends WebMvcConfigurerAdapter {
   public void addCorsMappings(CorsRegistry registry) {
      registry.addMapping("/**").allowedMethods(new String[]{"POST", "GET", "PUT", "OPTIONS", "DELETE"}).maxAge(3600L).allowCredentials(true).allowedOriginPatterns(new String[]{"*"});
   }
}
