From 83d3dbeb477e1bae7b9f80cbe46c4e4c619175b5 Mon Sep 17 00:00:00 2001 From: KKSU <15274802129@163.com> Date: Mon, 30 Sep 2024 16:33:41 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.0.122:9527/r/cms into xincheng --- src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/CmsTemplateServiceImpl.java | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/CmsTemplateServiceImpl.java b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/CmsTemplateServiceImpl.java index f08dbff..df4c3b5 100644 --- a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/CmsTemplateServiceImpl.java +++ b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/CmsTemplateServiceImpl.java @@ -90,6 +90,7 @@ return; } + FileUtil.touch(new File(staticPath + "/empty.txt")); for (File templateFile : files) { if (!templateFile.isFile()) { FileUtil.move(templateFile, new File(staticPath), true); @@ -251,10 +252,11 @@ String templatePath = FileUtils.path(cmsProperties.getTemplatePath(), company.getCode()); String staticPath = FileUtils.path(cmsProperties.getStaticPath(), company.getCode()); + String downloadPath = FileUtils.path(cmsProperties.getDownloadPath(), company.getCode()); String fileName = "template.zip"; - ZipUtil.zip(templatePath, staticPath + "/template.zip", true); - - return Result.ok("success", cmsProperties.getStaticUrl() + fileName); + ZipUtil.zip(FileUtil.file(downloadPath + "/template.zip"), true, FileUtil.file(templatePath), FileUtil.file(staticPath)); + String url = cmsProperties.getStaticUrl() + "download/" + company.getCode(); + return Result.ok("success", url +"/" + fileName); } } -- Gitblit v1.9.1