以Spring Boot的方式显示图片或下载文件到浏览器 请求例子:http://localhost:8080/image/1564550185144.jpeg 示例代码: import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation...
访问图片 http://localhost:8082/img/test 3.中文乱码解决 仅需要在dockerfile中添加一行代码即可 #中文字体显示为方框,导入中文字体解决(路径根据容器的字体路径调整) COPY simsun.ttf /usr/share/fonts/truetype/dejavu 四、linux部署 linux部署时需要直接在服务器安装字体(亲测有效) 注意:需要重启SpringBoot项目 在...