添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
在resources/static下存放图片,或者在resources/static下新建目录存放图片。访问图片的路径为新建的目录名/图片名
启动主程序,就可以直接访问了 这是我的URL:http://localhost:8081/imgs/lyf.png