springboot通過URL直接獲取圖片

第一步: 配置配置文件填加 classpath:/image/  第二步: 映射請求到圖片路徑下 registry.addResourceHandler("/image/**").addResourceLocations("file:" + SystemAPI.filePath); 注意:SystemAPI.filePath爲要訪問的文件夾路徑 整體代碼如圖 實現以上兩步便可以通過URL(http
相關文章
相關標籤/搜索