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

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

There is a newer version: 6.22.0
Show newest version
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.WebMvcConfigurerAdapter; @Configuration @ConditionalOnProperty(value = "cors.registry.enabled", matchIfMissing = true) public class CorsRegistryConfiguration extends WebMvcConfigurerAdapter { // 解决跨域问题 @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedHeaders("*") .allowedMethods("*") .allowedOrigins("*"); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy