在application.properties中需要配置:
spring.mvc.static-path-pattern=/images/** spring.resources.static-locations=file:E://images/positionImages
其中,static-path-pattern 中设置的值为前台需要访问服务器图片需要加的具体路径:
服务器访问地址 +/images/+图片名称
spring.resources.static-locations中设置了图片在服务器中存储的真正的地址