All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nepxion.discovery.console.configuration.CorsRegistryConfiguration Maven / Gradle / Ivy

package com.nepxion.discovery.console.configuration;

/**
 * 

Title: Nepxion Discovery

*

Description: Nepxion Discovery

*

Copyright: Copyright (c) 2017-2050

*

Company: Nepxion

* @author Haojun Ren * @version 1.0 */ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration @ConditionalOnProperty(value = "cors.registry.enabled", matchIfMissing = false) public class CorsRegistryConfiguration implements WebMvcConfigurer { // 解决跨域问题 @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedHeaders("*") .allowedMethods("*") .allowedOrigins("*"); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy