spring:
resources:
static-locations: classpath:/META-INF/resources, classpath:/resources/, classpath:/static/, classpath:/public/, classpath:/templates/,file:D://IDEA/resources/
mvc:
static-path-pattern: /**
在properties中配置spring.resources和spring.mvc即可,/**为要访问的路径,我的本地文件的地址为D://IDEA/resources,访问时输入127.0.0.1:8080/upload/img/111.jpg即可访问到本地的照片