桌码下载修复linux下下载不正常
This commit is contained in:
parent
a6cb86a126
commit
18970d0516
|
|
@ -29,6 +29,7 @@ import org.apache.dubbo.config.annotation.DubboService;
|
|||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -144,8 +145,7 @@ public class ShopTableServiceImpl extends ServiceImpl<ShopTableMapper, ShopTable
|
|||
|
||||
// 写入ZIP文件
|
||||
|
||||
ZipOutputStream zipOut = new ZipOutputStream(response.getOutputStream());
|
||||
try {
|
||||
try (ZipOutputStream zipOut = new ZipOutputStream(response.getOutputStream(), Charset.forName("gbk"))) {
|
||||
for (int i = 0; i < num; i++) {
|
||||
ZipEntry entry = new ZipEntry(fileNames.get(i));
|
||||
zipOut.putNextEntry(entry);
|
||||
|
|
@ -154,9 +154,7 @@ public class ShopTableServiceImpl extends ServiceImpl<ShopTableMapper, ShopTable
|
|||
zipOut.flush();
|
||||
zipOut.closeEntry();
|
||||
}
|
||||
}finally {
|
||||
zipOut.finish();
|
||||
zipOut.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue