springboot通过URL直接获取图片

第一步: 配置配置文件填加 classpath:/image/  第二步: 映射请求到图片路径下 registry.addResourceHandler("/image/**").addResourceLocations("file:" + SystemAPI.filePath); 注意:SystemAPI.filePath为要访问的文件夹路径 整体代码如图 实现以上两步便可以通过URL(http
相关文章
相关标签/搜索