新依赖:jquery的

<dependency>
    <groupId>org.webjars</groupId>
    <artifactId>jquery</artifactId>
    <version>3.4.1</version>
</dependency>

一、静态资源

看一下源码


@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
    if (!this.resourceProperties.isAddMappings()) {
        // 已禁用默认资源处理
        logger.debug("Default resource handling disabled");
        return;
    }
    // 缓存控制
    Duration cachePeriod = this.resourceProperties.getCache().getPeriod();
    CacheControl cacheControl = this.resourceProperties.getCache().getCachecontrol().toHttpCacheControl();
    // webjars 配置
    if (!registry.hasMappingForPattern("/webjars/**")) {
        customizeResourceHandlerRegistration(registry.addResourceHandler("/webjars/**")
                                             .addResourceLocations("classpath:/META-INF/resources/webjars/")
                                             .setCachePeriod(getSeconds(cachePeriod)).setCacheControl(cacheControl));
    }
    // 静态资源配置
    String staticPathPattern = this.mvcProperties.getStaticPathPattern();
    if (!registry.hasMappingForPattern(staticPathPattern)) {
        customizeResourceHandlerRegistration(registry.addResourceHandler(staticPathPattern)
                                             .addResourceLocations(getResourceLocations(this.resourceProperties.getStaticLocations()))
                                             .setCachePeriod(getSeconds(cachePeriod)).setCacheControl(cacheControl));
    }
}

优先级:

idea__SpringBoot微服务06——静态资源(新依赖),首页和图标定制-LMLPHP
我们也可以设置,让它失效

idea__SpringBoot微服务06——静态资源(新依赖),首页和图标定制-LMLPHP

失效

idea__SpringBoot微服务06——静态资源(新依赖),首页和图标定制-LMLPHP

二、首页和图标定制

1、首页可以放到这三个文件夹里面,会覆盖

idea__SpringBoot微服务06——静态资源(新依赖),首页和图标定制-LMLPHP
2、图标定制

idea__SpringBoot微服务06——静态资源(新依赖),首页和图标定制-LMLPHP
图标变了

idea__SpringBoot微服务06——静态资源(新依赖),首页和图标定制-LMLPHP

————————
创作不易,如觉不错,随手点赞,关注,收藏(* ̄︶ ̄),谢谢~~
12-09 23:16