瀏覽代碼

url编码

tags/V1.0.1
chengwang 1 年之前
父節點
當前提交
1135e727fc
共有 1 個檔案被更改,包括 6 行新增0 行删除
  1. +6
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/report/ExportReportService.java

+ 6
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/report/ExportReportService.java 查看文件

@@ -28,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.*;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.Comparator;
import java.util.List;
@@ -83,6 +84,11 @@ public class ExportReportService {
this.handle(request, airDataType, airDataList);
}
String filename = inspection.getName() + "-" + inspection.getCode() + "-" + airDataType.getDataType() + ".doc";
try {
filename = URLEncoder.encode(filename,"utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
String filePath = UploadFileConfig.uploadFolder + "/report/" + filename;
File fd = new File(UploadFileConfig.uploadFolder + "/report");
if (!fd.exists()) {

Loading…
取消
儲存