靜態資源
- 一、靜態資源
- 二、首頁和圖標定制
- ————————
- 創作不易,如覺不錯,隨手點贊,關注,收藏(* ̄︶ ̄),謝謝~~
新依賴: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、圖標定制
圖標變了