当前位置: 代码迷 >> 综合 >> POI、swagger 导出excel时,文件名为SwaggerBootstrapUiDownload.txt
  详细解决方案

POI、swagger 导出excel时,文件名为SwaggerBootstrapUiDownload.txt

热度:34   发布时间:2023-11-24 12:49:58.0

添加了produces = "application/octet-stream",出现了下载文件链接,但是下载的内容不对,文件名是SwaggerBootstrapUiDownload.txt,但是实际上我下载的是xlsx

 

解决:

<dependency><groupId>com.github.xiaoymin</groupId><artifactId>swagger-bootstrap-ui</artifactId><version>1.9.6</version>
</dependency>

 

<!--处理2003 excel-->
<dependency><groupId>org.apache.poi</groupId><artifactId>poi</artifactId><version>3.16</version>
</dependency>
<!--处理2007 excel-->
<dependency><groupId>org.apache.poi</groupId><artifactId>poi-ooxml</artifactId><version>3.16</version>
</dependency>

 

结果404了,我靠

  相关解决方案