mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-10 20:57:18 +08:00
refactor: 优化部分代码
修复 Sonar、Codacy 扫描问题
This commit is contained in:
@@ -70,10 +70,9 @@ public class ExcelUtils {
|
||||
Class<T> clazz,
|
||||
HttpServletResponse response) {
|
||||
try {
|
||||
fileName = String.format("%s_%s.xlsx", fileName, DateUtil
|
||||
.format(new Date(), DatePattern.PURE_DATETIME_PATTERN));
|
||||
fileName = URLUtil.encode(fileName);
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName);
|
||||
String exportFileName = URLUtil.encode(String.format("%s_%s.xlsx", fileName, DateUtil
|
||||
.format(new Date(), DatePattern.PURE_DATETIME_PATTERN)));
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + exportFileName);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
|
||||
EasyExcel.write(response.getOutputStream(), clazz)
|
||||
.autoCloseStream(false)
|
||||
|
Reference in New Issue
Block a user