KKSU
2024-01-09 cf68ee0531ebadbc7b27b8e6e56b9f3c4e893e05
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() + company.getCode() + "/" + 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);
    }
}