From f7a43888a4d288b394f38b996b328ab0560b588d Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Thu, 07 Jul 2022 19:49:35 +0800
Subject: [PATCH] 20220606
---
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/CmsTemplateServiceImpl.java | 10 ++++------
1 files changed, 4 insertions(+), 6 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 58c80e2..897950c 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
@@ -53,6 +53,7 @@
public void updateTemplate(MultipartFile upload) {
String templatePath = properties.getTemplatePath();
String staticPath = properties.getStaticPath();
+ Long companyId = LoginUserUtil.getCompanyId();
String filename = upload.getOriginalFilename();
String suffix = filename.substring(filename.lastIndexOf("."));
@@ -94,7 +95,7 @@
Document parse = Jsoup.parse(templateFile, null);
String attr = parse.head().attr("name");
CmsTemplateEntity cmsTemplate = new CmsTemplateEntity();
- cmsTemplate.setCompanyId(10L);
+ cmsTemplate.setCompanyId(companyId);
if (name.endsWith(".list.html")) {
cmsTemplate.setType(2);
} else if (name.endsWith(".article.html")) {
@@ -116,7 +117,7 @@
Document parse = Jsoup.parse(file, null);
String attr = parse.head().attr("name");
CmsTemplateEntity cmsTemplate = new CmsTemplateEntity();
- cmsTemplate.setCompanyId(LoginUserUtil.getCompanyId());
+ cmsTemplate.setCompanyId(companyId);
if (file.getName().endsWith(".list.html")) {
cmsTemplate.setType(2);
} else if (file.getName().endsWith(".article.html")) {
@@ -164,12 +165,9 @@
@Override
public Result viewTemplateInfo(Long id) {
- Long companyId = LoginUserUtil.getCompanyId();
CmsTemplateEntity cmsTemplateEntity = this.baseMapper.selectById(id);
- String baseUrl = cmsProperties.getBaseUrl();
String templatePath = cmsProperties.getTemplatePath();
- String htmlUrl = baseUrl + templatePath;
- String pathName = htmlUrl + "\\" + cmsTemplateEntity.getPath();
+ String pathName = FileUtils.path(templatePath, cmsTemplateEntity.getPath());
byte[] bytes = new byte[0];
try {
--
Gitblit v1.9.1