Bladeren bron

url编码

tags/V1.0.1
chengwang 1 jaar geleden
bovenliggende
commit
1135e727fc
1 gewijzigde bestanden met toevoegingen van 6 en 0 verwijderingen
  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 Bestand weergeven

@@ -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()) {

Laden…
Annuleren
Opslaan