Helius
2022-07-09 72e4c1f558c3a0ae7a3730a3b80da11f3e7729a7
fix template upload
2 files modified
7 ■■■■ changed files
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/CmsTemplateServiceImpl.java 5 ●●●●● patch | view | raw | blame | history
src/main/resources/application.yml 2 ●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/CmsTemplateServiceImpl.java
@@ -28,6 +28,7 @@
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
@@ -113,6 +114,10 @@
        staticPathParser(parse, "link", "href");
        staticPathParser(parse, "script", "src");
        FileOutputStream outputStream = new FileOutputStream(file);
        outputStream.write(parse.html().getBytes());
        outputStream.close();
        CmsTemplateEntity cmsTemplate = new CmsTemplateEntity();
        cmsTemplate.setCompanyId(companyId);
        if (file.getName().endsWith(".list.html")) {
src/main/resources/application.yml
@@ -99,7 +99,7 @@
cms:
  base-url: http://localhost
  static-url: http://120.27.238.55:8000/cms/static/
  template-path: /Users/helius/Desktop/template-online
  template-path: /Users/helius/Desktop/template
  static-path: /Users/helius/Desktop/static
  output-path: /Users/helius/Desktop/template-online/output