静态资源
- 一、静态资源
- 二、首页和图标定制
- ————————
- 创作不易,如觉不错,随手点赞,关注,收藏(* ̄︶ ̄),谢谢~~
新依赖: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));}
}
优先级:
我们也可以设置,让它失效
失效
二、首页和图标定制
1、首页可以放到这三个文件夹里面,会覆盖
2、图标定制
图标变了