spring-boot-plus V1.2.1 发布,文件上传下载和静态资源访问

来源: 投稿
作者: geekidea
2019-08-21 09:00:00

Introduction

spring-boot-plus 是一套集成 spring boot 常用开发组件的后台快速开发框架

Purpose

每个人都可以独立、快速、高效地开发项目!

Everyone can develop projects independently, quickly and efficiently!

[V1.2.1-RELEASE] 2019.08.21

⭐️ New Features

  • 文件上传保存到服务器指定目录
  • 文件下载
  • 访问上传的图片等资源
  • 启用项目静态资源访问,可访问static/templates目录下资源

⚡️ Optimization

📝 Added/Modified

  • Add UploadController 上传控制器

  • Add DownloadController 下载控制器

  • Add ImageController 图片访问控制器

  • Add ResourceInterceptor 资源拦截器

  • Add welcome.html 在static目录下

  • Add springbootplus.html 在templates目录下

  • Add ContentTypeUtil 文件类型工具

  • Add mime-type.properties 文件类型自定义拓展配置

  • Add UploadUtil 上传工具类,UploadFileNameHandle 文件名称回调接口,DefaultUploadFileNameHandleImpl 默认文件名称实现类

  • Add DownloadUtil 下载工具类

  • Modify WebMvcConfig 注册资源拦截器,项目静态资源访问配置

  • Modify SpringBootPlusConfig 创建 ResourceInterceptor 资源拦截器

  • Modify SpringBootPlusInterceptorConfig 添加 resourceConfig 资源拦截器配置

  • Modify SpringBootPlusProperties 添加 uploadPath,resourceAccessPath,resourceAccessPatterns,resourceAccessUrl属性

  • Modify application.ymlapplication-local.yml 添加文件上传/下载配置

  • Modify mysql_spring_boot_plus.sql 添加创建数据库语句,如果不存在,则创建

🐞 Bug Fixes

  • 拦截器exclude-path,include-path字符串配置问题,已修改为数组接收String[] excludePath,String[] includePath

📔 Documentation

🔨 Dependency Upgrades

  • Upgrade to springboot 2.1.7.RELEASE

官网地址:springboot.plus

GITHUB:https://github.com/geekidea/spring-boot-plus

GITEE:https://gitee.com/geekidea/spring-boot-plus

 

展开阅读全文
点击加入讨论🔥(7) 发布并加入讨论🔥
本篇精彩评论
File downloadFile = new File(downloadDir,downloadFileName);
这样是有安全漏洞的 导致服务器上所有文件都可以被下载
需要对downloadFileName这个参数做安全处理 要去掉“.."
2019-08-21 10:01
3
举报
7 评论
36 收藏
分享
返回顶部
顶部