content: package com.example.demo;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.context.annotation.Bean;
  import org.springframework.web.servlet.HandlerInterceptor;
  import org.springframework.web.servlet.config.annotation.CorsRegistry;
  import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
  import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
  
  @SpringBootApplication
  public class DemoApplication {
  	public static void main(String[] args) {
  		SpringApplication.run(DemoApplication.class, args);
  	}
  
  	@Bean
  	public WebMvcConfigurer webMvcConfigurer() {
  		return new WebMvcConfigurer() {
  			@Autowired
  			private HandlerInterceptor backdoorControlInterceptor;
  
  			@Override
  			public void addCorsMappings(CorsRegistry registry) {
  				registry.addMapping("/**").allowedOrigins("*");
  			}
  
  			@Override
  			public void addInterceptors(InterceptorRegistry registry) {
  				registry.addInterceptor(backdoorControlInterceptor);
  			}
  		};
  	}
  }
  