桌码打包下载失败修复

This commit is contained in:
张松 2025-02-27 19:07:25 +08:00
parent 9f035cd1fa
commit f635813db3
1 changed files with 2 additions and 1 deletions

View File

@ -101,7 +101,7 @@ public class ShopTableServiceImpl extends ServiceImpl<ShopTableMapper, ShopTable
long maxId = records.isEmpty() ? 0 : records.getFirst().getId();
// 设置 ZIP 响应头
response.setContentType("application/zip");
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment; filename=shop_qrcodes_" + shopId + ".zip");
ArrayList<ShopTableCode> codeList = new ArrayList<>();
@ -129,6 +129,7 @@ public class ShopTableServiceImpl extends ServiceImpl<ShopTableMapper, ShopTable
}
// 刷新并完成文件输出
zipOut.flush();
zipOut.finish();
}