|
@@ -35,6 +35,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.io.OutputStream;
|
|
import java.io.OutputStream;
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
import java.text.DateFormat;
|
|
import java.text.DateFormat;
|
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
@@ -198,16 +199,20 @@ public class AdminCustomerApiController extends BaseApiController{
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
- response.addHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes(),"iso-8859-1"));
|
|
|
|
|
|
|
+ response.addHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes(), StandardCharsets.ISO_8859_1));
|
|
|
response.setContentType("application/octet-stream;charset=utf-8");
|
|
response.setContentType("application/octet-stream;charset=utf-8");
|
|
|
try {
|
|
try {
|
|
|
// 返回数据流
|
|
// 返回数据流
|
|
|
wb.write(out);
|
|
wb.write(out);
|
|
|
- out.flush();
|
|
|
|
|
- out.close();
|
|
|
|
|
|
|
+ if (out != null) {
|
|
|
|
|
+ out.flush();
|
|
|
|
|
+ out.close();
|
|
|
|
|
+ }
|
|
|
} finally {
|
|
} finally {
|
|
|
- out.flush();
|
|
|
|
|
- out.close();
|
|
|
|
|
|
|
+ if (out != null) {
|
|
|
|
|
+ out.flush();
|
|
|
|
|
+ out.close();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return res;
|
|
return res;
|