Skip to content

Commit

Permalink
fix: 修复访问 doc.html 接口文档,控制台报 No mapping for GET /favicon.ico 警告的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Aug 15, 2023
1 parent b23b00d commit 94f88ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {
.setCachePeriod(0);
registry.addResourceHandler(localStorageProperties.getAvatarPattern()).addResourceLocations(avatarUtl)
.setCachePeriod(0);
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/favicon.ico").addResourceLocations("classpath:/");
registry.addResourceHandler("/doc.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/")
.setCacheControl(CacheControl.maxAge(5, TimeUnit.HOURS).cachePublic());
}
Expand Down
Binary file not shown.
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,18 @@ limitations under the License.
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/**</include>
<include>**/*.yml</include>
</includes>
<!-- 启用过滤,即替换对应资源中的变量 -->
<filtering>true</filtering>
</resource>
<!-- 除 YAML 配置文件外,其他配置文件不需要进行变量替换 -->
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
</build>

Expand Down

0 comments on commit 94f88ba

Please sign in to comment.