Helius
2022-07-11 a508775d5c69e61e605c8f00fc18e70279444869
add companyCode
19 files modified
182 ■■■■ changed files
src/main/java/com/xcong/farmer/cms/common/utils/FileUtils.java 6 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/configurations/CmsConfig.java 7 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/configurations/properties/CmsProperties.java 18 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/core/handler/ArticleDataParserHandler.java 7 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/core/handler/ArticlesDataParserHandler.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/core/handler/ColumnDataParserHandler.java 9 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/core/handler/NavDataParserHandler.java 11 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/core/handler/PageDataParserHandler.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/core/node/Template.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/core/template/Configuration.java 6 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/core/template/TemplateConfiguration.java 10 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/core/service/ICmsCoreService.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/core/service/impl/CmsCoreServiceImpl.java 26 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/system/mapper/WebSetMapper.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/CmsTemplateServiceImpl.java 27 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ColumnServiceImpl.java 12 ●●●● patch | view | raw | blame | history
src/main/resources/application.yml 6 ●●●● patch | view | raw | blame | history
src/main/resources/mapper/WebSetMapper.xml 13 ●●●●● patch | view | raw | blame | history
src/test/java/com/xcong/farmer/cms/KssframeworkApplicationTests.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/common/utils/FileUtils.java
@@ -22,10 +22,14 @@
    public static String path(String path, String fileName) {
        File file = new File(path);
        if (!file.isDirectory()){
        if (file.exists() && !file.isDirectory()){
            return "";
        }
        if (!file.exists()) {
            file.mkdirs();
        }
        String dir = path(path);
        return dir + fileName;
    }
src/main/java/com/xcong/farmer/cms/configurations/CmsConfig.java
@@ -3,11 +3,15 @@
import com.xcong.farmer.cms.configurations.properties.CmsProperties;
import com.xcong.farmer.cms.core.template.TemplateConfiguration;
import com.xcong.farmer.cms.core.template.TemplateLoader;
import com.xcong.farmer.cms.modules.system.entity.DataDictionaryCustom;
import com.xcong.farmer.cms.modules.system.mapper.DataDictionaryCustomMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.List;
/**
 * @author wzy
@@ -23,7 +27,8 @@
    @Bean
    public TemplateConfiguration templateConfiguration() {
        log.info("CMS管理系统");
        TemplateConfiguration cfg = new TemplateConfiguration(cmsProperties.getTemplatePath(), cmsProperties.getStaticPath(), cmsProperties.getOutputPath(), cmsProperties.getBaseUrl(), cmsProperties.getStaticUrl());
        TemplateConfiguration cfg = new TemplateConfiguration(cmsProperties.getTemplatePath(), cmsProperties.getStaticPath(), cmsProperties.getOutputPath(), cmsProperties.getApiUrl(), cmsProperties.getStaticUrl());
        TemplateLoader loader = new TemplateLoader(cfg);
        cfg.templateLoader(loader);
        return cfg;
src/main/java/com/xcong/farmer/cms/configurations/properties/CmsProperties.java
@@ -3,19 +3,35 @@
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
@Data
@Configuration
@ConfigurationProperties(prefix = "cms")
public class CmsProperties {
    /**
     * 模板保存地址
     */
    private String templatePath;
    /**
     * 静态文件保存地址
     */
    private String staticPath;
    /**
     * html输出地址
     */
    private String outputPath;
    /**
     * 静态文件访问地址
     */
    private String staticUrl;
    private String baseUrl;
    /**
     * api请求地址
     */
    private String apiUrl;
}
src/main/java/com/xcong/farmer/cms/core/handler/ArticleDataParserHandler.java
@@ -25,10 +25,11 @@
public class ArticleDataParserHandler implements DataParserHandler {
    private final ArticleMapper articleMapper = SpringContextHolder.getBean(ArticleMapper.class);
    private final CmsProperties cmsProperties = SpringContextHolder.getBean(CmsProperties.class);
    @Override
    public void dataParser(AttrNode node) {
        log.info("######文章解析########");
        String baseUrl = (String) node.getSystemDataValue("baseUrl");
        Article tag = (Article) node.getParam();
        ArticleEntity data = articleMapper.selectById(tag.getId());
@@ -40,7 +41,7 @@
            if (prevEntity.getType() == 2) {
                prev.setUrl(prevEntity.getArticleUrl());
            } else {
                prev.setUrl(cmsProperties.getBaseUrl() + prevEntity.getPath() + "/" + prevEntity.getId() + ".html");
                prev.setUrl(baseUrl + prevEntity.getPath() + "/" + prevEntity.getId() + ".html");
            }
            articleData.setPrev(prev);
@@ -54,7 +55,7 @@
            if (nextEntity.getType() == 2) {
                next.setUrl(nextEntity.getArticleUrl());
            } else {
                next.setUrl(cmsProperties.getBaseUrl() + nextEntity.getPath() + "/" + nextEntity.getId() + ".html");
                next.setUrl(baseUrl + nextEntity.getPath() + "/" + nextEntity.getId() + ".html");
            }
            articleData.setNext(next);
src/main/java/com/xcong/farmer/cms/core/handler/ArticlesDataParserHandler.java
@@ -27,12 +27,14 @@
public class ArticlesDataParserHandler implements DataParserHandler  {
    private ArticleMapper articleMapper = SpringContextHolder.getBean(ArticleMapper.class);
    private CmsProperties cmsProperties = SpringContextHolder.getBean(CmsProperties.class);
    @Override
    public void dataParser(AttrNode node) {
        log.info("文章列表解析");
        Long companyId = (Long) node.getSystemDataValue("companyId");
        String companyCode = (String) node.getSystemDataValue("companyCode");
        String baseUrl = (String) node.getSystemDataValue("baseUrl");
        Articles param = (Articles) node.getParam();
        ArticleEntity article = new ArticleEntity();
        Page<ArticleEntity> page = new Page<>(Integer.parseInt(param.getPage()), Integer.parseInt(param.getLimit()));
@@ -59,20 +61,20 @@
        List<ArticleData> list = new ArrayList<>();
        for (ArticleEntity record : listPage.getRecords()) {
            ArticleData articleData = entityToData(record);
            ArticleData articleData = entityToData(record, baseUrl + companyCode);
            list.add(articleData);
        }
        node.setData(list);
    }
    public ArticleData entityToData(ArticleEntity article) {
    public ArticleData entityToData(ArticleEntity article, String baseUrl) {
        ArticleData articleData = ArticleConversion.INSTANCE.entityToData(article);
        if (article.getType() == 2) {
            articleData.setUrl(article.getArticleUrl());
        } else {
            articleData.setUrl(cmsProperties.getBaseUrl() + article.getPath() + "/" + article.getId() + ".html");
            articleData.setUrl(baseUrl + article.getPath() + "/" + article.getId() + ".html");
        }
src/main/java/com/xcong/farmer/cms/core/handler/ColumnDataParserHandler.java
@@ -26,12 +26,13 @@
    private ColumnMapper columnMapper = SpringContextHolder.getBean(ColumnMapper.class);
    private ArticleMapper articleMapper = SpringContextHolder.getBean(ArticleMapper.class);
    private CmsProperties cmsProperties = SpringContextHolder.getBean(CmsProperties.class);
    private String baseUrl = "";
    @Override
    public void dataParser(AttrNode attrNode) {
        log.info("栏目解析");
        Long companyId = (Long) attrNode.getSystemDataValue("companyId");
        baseUrl = (String) attrNode.getSystemDataValue("baseUrl");
        Column param = (Column) attrNode.getParam();
@@ -59,14 +60,14 @@
    public ColumnData columnToData(ColumnEntity column) {
        ColumnData columnData = ColumnConversion.INSTANCE.entityToData(column);
        columnData.setUrl(cmsProperties.getBaseUrl() + column.getPath());
        columnData.setUrl(baseUrl + column.getPath());
        if (column.getType() == 2) {
            if (column.getTargetType() == 1) {
                ArticleEntity article = this.articleMapper.selectArticleById(Long.parseLong(column.getTargetUrl()));
                columnData.setUrl(cmsProperties.getBaseUrl() + article.getPath() + "/" + article.getId() + ".html");
                columnData.setUrl(baseUrl + article.getPath() + "/" + article.getId() + ".html");
            } else if (column.getTargetType() == 2) {
                ColumnEntity columnEntity = this.columnMapper.selectByCodeAndCompanyId(column.getTargetUrl(), column.getCompanyId());
                columnData.setUrl(cmsProperties.getBaseUrl() + columnEntity.getPath());
                columnData.setUrl(baseUrl + columnEntity.getPath());
            } else {
                columnData.setUrl(column.getTargetUrl());
            }
src/main/java/com/xcong/farmer/cms/core/handler/NavDataParserHandler.java
@@ -28,12 +28,13 @@
    private ColumnMapper columnMapper = SpringContextHolder.getBean(ColumnMapper.class);
    private ArticleMapper articleMapper = SpringContextHolder.getBean(ArticleMapper.class);
    private CmsProperties cmsProperties = SpringContextHolder.getBean(CmsProperties.class);
    private String baseUrl = "";
    @Override
    public void dataParser(AttrNode node) {
        log.info("导航栏解析");
        Long companyId = (Long) node.getSystemDataValue("companyId");
        baseUrl = (String) node.getSystemDataValue("baseUrl");
        List<ColumnEntity> columns = columnMapper.selectColumnByParentId(0L, companyId, 1);
@@ -45,7 +46,7 @@
        NavData index = new NavData();
        index.setTitle("首页");
        index.setUrl(cmsProperties.getBaseUrl());
        index.setUrl(baseUrl);
        index.setCode("index");
        list.add(index);
@@ -75,14 +76,14 @@
    public NavData columnToNav(ColumnEntity column) {
        NavData navData = ColumnConversion.INSTANCE.columnToNav(column);
        navData.setUrl(cmsProperties.getBaseUrl() + column.getPath());
        navData.setUrl(baseUrl + column.getPath());
        if (column.getType() == 2) {
            if (column.getTargetType() == 1) {
                ArticleEntity article = this.articleMapper.selectArticleById(Long.parseLong(column.getTargetUrl()));
                navData.setUrl(cmsProperties.getBaseUrl() + article.getPath() + "/" + article.getId() + ".html");
                navData.setUrl(baseUrl + article.getPath() + "/" + article.getId() + ".html");
            } else if (column.getTargetType() == 2) {
                ColumnEntity columnEntity = this.columnMapper.selectByCodeAndCompanyId(column.getTargetUrl(), column.getCompanyId());
                navData.setUrl(cmsProperties.getBaseUrl() + columnEntity.getPath());
                navData.setUrl(baseUrl + columnEntity.getPath());
            } else {
                navData.setUrl(column.getTargetUrl());
            }
src/main/java/com/xcong/farmer/cms/core/handler/PageDataParserHandler.java
@@ -27,12 +27,12 @@
public class PageDataParserHandler implements DataParserHandler {
    private ArticleMapper articleMapper = SpringContextHolder.getBean(ArticleMapper.class);
    private CmsProperties cmsProperties = SpringContextHolder.getBean(CmsProperties.class);
    @Override
    public void dataParser(AttrNode attrNode) {
        log.info("分页解析");
        synchronized (this) {
            Template.HAS_PAGING = true;
            String baseUrl = (String) attrNode.getSystemDataValue("baseUrl");
            Long companyId = (Long) attrNode.getSystemDataValue("companyId");
            Pagination param = (Pagination) attrNode.getParam();
@@ -49,7 +49,7 @@
            pageData.setTotalCnt((int) pageList.getSize());
            if (CollUtil.isNotEmpty(pageList.getRecords())) {
                String path = cmsProperties.getBaseUrl() + "/" + param.getCode();
                String path = baseUrl + "/" + param.getCode();
                String filename = "index_{}.html";
                List<PageChildData> list = new ArrayList<>();
src/main/java/com/xcong/farmer/cms/core/node/Template.java
@@ -97,7 +97,7 @@
            sb.append(partNode.getHtml());
        }
        document = Jsoup.parse(sb.toString());
        String outPath = path(outputPath);
        String outPath = path(outputPath) + system.get("companyCode");
        String html = document.html();
        try {
src/main/java/com/xcong/farmer/cms/core/template/Configuration.java
@@ -6,7 +6,7 @@
public abstract class Configuration {
    protected static String BASE_URL;
    protected static String API_URL;
    protected static String STATIC_URL;
    protected static String staticPath;
    protected static String templatePath;
@@ -15,11 +15,11 @@
    public Configuration() {
    }
    public Configuration(String templatePath, String staticPath, String outputPath, String baseUrl, String staticUrl) {
    public Configuration(String templatePath, String staticPath, String outputPath, String apiUrl, String staticUrl) {
        Configuration.staticPath = staticPath;
        Configuration.templatePath = templatePath;
        Configuration.outputPath = outputPath;
        Configuration.BASE_URL = baseUrl;
        Configuration.API_URL = apiUrl;
        Configuration.STATIC_URL = staticUrl;
    }
src/main/java/com/xcong/farmer/cms/core/template/TemplateConfiguration.java
@@ -1,5 +1,6 @@
package com.xcong.farmer.cms.core.template;
import com.xcong.farmer.cms.common.utils.FileUtils;
import com.xcong.farmer.cms.core.node.PartNode;
import com.xcong.farmer.cms.core.node.Template;
import lombok.extern.slf4j.Slf4j;
@@ -32,10 +33,13 @@
        if (this.templateLoader == null) {
            throw new RuntimeException("TemplateLoader do not able to be null");
        }
        map.put("apiUrl", API_URL);
        String companyCode = (String) map.get("companyCode");
        log.info("解析开始执行--#类型:{}#--#模板名称:{}#--#ID:{}#", map.get("templateType"), templateName, map.get("id"));
        this.templateLoader.data(map);
        Template template = template(templateName);
        Template template = template(FileUtils.path(templatePath, companyCode), templateName);
        template.output(outputPath);
        // 判断是否有分页,有则执行。从第二页开始
@@ -43,13 +47,13 @@
        while(Template.HAS_PAGING) {
            map.put("page", i);
            this.templateLoader.data(map);
            Template pageTemplate = template(templateName);
            Template pageTemplate = template(FileUtils.path(templatePath, companyCode), templateName);
            pageTemplate.output(outputPath);
            i++;
        }
    }
    public Template template(String templateName) {
    public Template template(String templatePath, String templateName) {
        return template(new File(path(templatePath) + templateName));
    }
src/main/java/com/xcong/farmer/cms/modules/core/service/ICmsCoreService.java
@@ -38,4 +38,6 @@
    void indexProcess(Map<String, Object> map, String templateName);
    void process(Map<String, Object> map, String templateType, String templateName);
}
src/main/java/com/xcong/farmer/cms/modules/core/service/impl/CmsCoreServiceImpl.java
@@ -4,6 +4,7 @@
import cn.hutool.core.util.StrUtil;
import com.xcong.farmer.cms.core.template.TemplateConfiguration;
import com.xcong.farmer.cms.modules.core.service.ICmsCoreService;
import com.xcong.farmer.cms.modules.system.mapper.WebSetMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -28,12 +29,16 @@
    @Autowired
    private TemplateConfiguration cfg;
    @Autowired
    private WebSetMapper webSetMapper;
    @Override
    public void articleProcess(Map<String, Object> data, String templateName, String templatePath) {
        data.put("templateType", "article");
        data.put("templatePath", templatePath);
        data.put("templateName", data.get("id"));
        globalData(data);
        if (StrUtil.isEmpty(templateName)) {
            templateName = "defualt.article.html";
        }
@@ -74,6 +79,7 @@
    public void columnProcess(Map<String, Object> data, String templateName) {
        data.put("templateType", "column");
        data.put("page", 1);
        globalData(data);
        if (StrUtil.isEmpty(templateName)) {
            templateName = "defualt.list.html";
        }
@@ -89,6 +95,7 @@
    @Override
    public void indexProcess(@NotNull Map<String, Object> data, String templateName) {
        data.put("templateType", "index");
        globalData(data);
        if (StrUtil.isEmpty(templateName)) {
            templateName = "index.html";
        }
@@ -100,4 +107,23 @@
            log.error("发布首页错误", e);
        }
    }
    @Override
    public void process(Map<String, Object> data, String templateType, String templateName) {
        data.put("templateType", templateType);
        globalData(data);
        try {
            cfg.process(data, templateName);
        } catch (Exception e) {
            e.printStackTrace();
            log.error("发布错误", e);
        }
    }
    private void globalData(Map<String, Object> data) {
        Long companyId = (Long) data.get("companyId");
        Map<String, String> globalSetting = webSetMapper.selectSiteGlobalSetting(companyId);
        data.putAll(globalSetting);
    }
}
src/main/java/com/xcong/farmer/cms/modules/system/mapper/WebSetMapper.java
@@ -4,7 +4,11 @@
import com.xcong.farmer.cms.modules.system.entity.WebSettingEntity;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
public interface WebSetMapper extends BaseMapper<WebSettingEntity> {
    WebSettingEntity selectByCompanyId(@Param("companyId") Long companyId);
    Map<String, String> selectSiteGlobalSetting(@Param("companyId") Long companyId);
}
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/CmsTemplateServiceImpl.java
@@ -15,7 +15,9 @@
import com.xcong.farmer.cms.modules.system.dto.AdminSaveTemplateInfoDto;
import com.xcong.farmer.cms.modules.system.dto.TemplateListDto;
import com.xcong.farmer.cms.modules.system.entity.CmsTemplateEntity;
import com.xcong.farmer.cms.modules.system.entity.CompanyEntity;
import com.xcong.farmer.cms.modules.system.mapper.CmsTemplateMapper;
import com.xcong.farmer.cms.modules.system.mapper.CompanyMapper;
import com.xcong.farmer.cms.modules.system.service.ICmsTemplateService;
import com.xcong.farmer.cms.modules.system.util.LoginUserUtil;
import org.jsoup.Jsoup;
@@ -46,6 +48,10 @@
    @Autowired
    private CmsProperties properties;
    @Autowired
    private CompanyMapper companyMapper;
    private List<String> fileSuffix = Arrays.asList(".zip", ".html");
    @Override
@@ -53,6 +59,11 @@
        String templatePath = properties.getTemplatePath();
        String staticPath = properties.getStaticPath();
        Long companyId = LoginUserUtil.getCompanyId();
        CompanyEntity company = companyMapper.selectById(companyId);
        String companyCode = company.getCode();
        templatePath = FileUtils.path(templatePath, companyCode);
        staticPath = FileUtils.path(staticPath, companyCode);
        String filename = upload.getOriginalFilename();
        String suffix = filename.substring(filename.lastIndexOf("."));
@@ -91,14 +102,14 @@
                        continue;
                    }
                    insertTemplate(templateFile, companyId);
                    insertTemplate(templateFile, companyId, companyCode);
                }
            }
            if (".html".equals(suffix)) {
                FileUtil.touch(file);
                insertTemplate(file, companyId);
                insertTemplate(file, companyId, companyCode);
            }
        } catch (IOException e) {
            e.printStackTrace();
@@ -106,13 +117,13 @@
        }
    }
    private void insertTemplate(File file, Long companyId) throws IOException {
    private void insertTemplate(File file, Long companyId, String companyCode) throws IOException {
        Document parse = Jsoup.parse(file, null);
        String attr = parse.head().attr("name");
        staticPathParser(parse, "img", "src");
        staticPathParser(parse, "link", "href");
        staticPathParser(parse, "script", "src");
        staticPathParser(parse, "img", "src", companyCode);
        staticPathParser(parse, "link", "href", companyCode);
        staticPathParser(parse, "script", "src", companyCode);
        FileOutputStream outputStream = new FileOutputStream(file);
        outputStream.write(parse.html().getBytes());
@@ -133,7 +144,7 @@
        this.baseMapper.insert(cmsTemplate);
    }
    private void staticPathParser(Document document, String tagName, String attrKey) {
    private void staticPathParser(Document document, String tagName, String attrKey, String companyCode) {
        Elements elements = document.getElementsByTag(tagName);
        if (elements.isEmpty()) {
            return;
@@ -142,7 +153,7 @@
        for (Element element : elements) {
            String attr = element.attr(attrKey);
            if (StrUtil.isNotBlank(attr) && !attr.contains("http://") && !attr.contains("https://")) {
                element.attr(attrKey, cmsProperties.getStaticUrl() + attr);
                element.attr(attrKey, cmsProperties.getStaticUrl() + companyCode + "/" + attr);
            }
        }
    }
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ColumnServiceImpl.java
@@ -8,7 +8,6 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xcong.farmer.cms.common.contants.AppContants;
import com.xcong.farmer.cms.common.response.Result;
import com.xcong.farmer.cms.configurations.properties.CmsProperties;
import com.xcong.farmer.cms.modules.system.dto.AdminAddColumnDto;
import com.xcong.farmer.cms.modules.system.dto.AdminColumnDto;
import com.xcong.farmer.cms.modules.system.dto.AdminDeleteDto;
@@ -42,8 +41,6 @@
    private ArticleMapper articleMapper;
    @Autowired
    private CompanyMapper companyMapper;
    @Autowired
    private CmsProperties cmsProperties;
    @Override
    public Result getColumnInPage(AdminColumnDto adminColumnDto) {
@@ -167,18 +164,21 @@
        adminSeeColumnInfoVo.setType(columnEntity.getType());
        adminSeeColumnInfoVo.setTargetType(columnEntity.getTargetType());
        adminSeeColumnInfoVo.setContentType(columnEntity.getContentType());
        CompanyEntity companyEntity = companyMapper.selectById(LoginUserUtil.getCompanyId());
        if (columnEntity.getType() == 2) {
            if (columnEntity.getTargetType() == 1) {
                ArticleEntity articleEntity = articleMapper.selectById(Long.parseLong(columnEntity.getTargetUrl()));
                adminSeeColumnInfoVo.setTargetName(articleEntity.getTitle());
                adminSeeColumnInfoVo.setUrl(cmsProperties.getBaseUrl() + columnEntity.getPath() + "/" + columnEntity.getTargetUrl() + ".html");
                adminSeeColumnInfoVo.setUrl(companyEntity.getWebAddress() + columnEntity.getPath() + "/" + columnEntity.getTargetUrl() + ".html");
            } else if (columnEntity.getTargetType() == 2) {
                ColumnEntity column = this.baseMapper.selectByCodeAndCompanyId(columnEntity.getTargetUrl(), LoginUserUtil.getCompanyId());
                adminSeeColumnInfoVo.setTargetName(column.getColumnName());
                adminSeeColumnInfoVo.setUrl(cmsProperties.getBaseUrl() + column.getPath());
                adminSeeColumnInfoVo.setUrl(companyEntity.getWebAddress() + column.getPath());
            }
        } else {
            adminSeeColumnInfoVo.setUrl(cmsProperties.getBaseUrl() + columnEntity.getPath());
            adminSeeColumnInfoVo.setUrl(companyEntity.getWebAddress() + columnEntity.getPath());
        }
        adminSeeColumnInfoVo.setTargetUrl(columnEntity.getTargetUrl());
        return Result.ok(adminSeeColumnInfoVo);
src/main/resources/application.yml
@@ -99,9 +99,9 @@
    path: /image/
cms:
  base-url: http://localhost
  api-url: http://120.27.238.55:8878
  static-url: http://120.27.238.55:8000/cms/static/
  template-path: /Users/helius/Desktop/template
  static-path: /Users/helius/Desktop/static
  template-path: /Users/helius/Desktop/template-online/template
  static-path: /Users/helius/Desktop/template-online/static
  output-path: /Users/helius/Desktop/template-online/output
src/main/resources/mapper/WebSetMapper.xml
@@ -11,4 +11,17 @@
        where a.company_id=#{companyId} and a.company_id=b.id
    </select>
    <select id="selectSiteGlobalSetting" resultType="java.util.Map">
        select
            a.title title,
            a.seo_title seoTitle,
            a.seo_keyword seoKeyword,
            a.seo_description seoDescription,
            a.logo_url logo,
            b.web_address baseUrl,
            b.code companyCode
        from t_web_setting a, t_company b
        where a.company_id=#{companyId} and a.company_id=b.id
    </select>
</mapper>
src/test/java/com/xcong/farmer/cms/KssframeworkApplicationTests.java
@@ -108,7 +108,7 @@
    public void viewTemplateInfo() {
        Long id = 4L;
        CmsTemplateEntity cmsTemplateEntity = cmsTemplateMapper.selectById(id);
        String htmlUrl = cmsProperties.getBaseUrl() + cmsProperties.getTemplatePath();
        String htmlUrl = "" + cmsProperties.getTemplatePath();
        File uploadDir = new File(htmlUrl);
        if (!uploadDir.isDirectory()) {
            uploadDir.mkdir();