content: package com.sqmusicplus.v3.config;
  
  import com.fasterxml.jackson.databind.ObjectMapper;
  import com.fasterxml.jackson.databind.SerializationFeature;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
  import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
  
  /**
   * @Classname MyWebMvcConfig
   * @Description 静态资源映射
   * @Version 1.0.0
   * @Date 2022/7/29 16:20
   * @Created by SQ
   */
  @Configuration
  public class MyWebMvcConfig implements WebMvcConfigurer {
      @Override
      public void addResourceHandlers(ResourceHandlerRegistry registry) {
          registry.addResourceHandler("/**")
                  .addResourceLocations("classpath:/static/")
                  .addResourceLocations("classpath:/public/")
                  .addResourceLocations("classpath:/resources/")
                  .addResourceLocations("classpath:/META-INF/resources/");
          registry.addResourceHandler("/zy/**").addResourceLocations("classpath:/static/");
          registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
  
          WebMvcConfigurer.super.addResourceHandlers(registry);
      }
      @Bean
      public ObjectMapper objectMapper() {
          return new ObjectMapper().disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
      }
  }
  