diff --git a/src/main/java/com/gxwebsoft/cms/service/impl/CmsNavigationServiceImpl.java b/src/main/java/com/gxwebsoft/cms/service/impl/CmsNavigationServiceImpl.java index bef98e0..2c13417 100644 --- a/src/main/java/com/gxwebsoft/cms/service/impl/CmsNavigationServiceImpl.java +++ b/src/main/java/com/gxwebsoft/cms/service/impl/CmsNavigationServiceImpl.java @@ -6,10 +6,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.gxwebsoft.cms.entity.CmsDesign; import com.gxwebsoft.cms.entity.CmsModel; +import com.gxwebsoft.cms.entity.CmsPage; import com.gxwebsoft.cms.mapper.CmsNavigationMapper; import com.gxwebsoft.cms.service.CmsDesignService; import com.gxwebsoft.cms.service.CmsModelService; import com.gxwebsoft.cms.service.CmsNavigationService; +import com.gxwebsoft.cms.service.CmsPageService; import com.gxwebsoft.cms.entity.CmsNavigation; import com.gxwebsoft.cms.param.CmsNavigationParam; import com.gxwebsoft.common.core.exception.BusinessException; @@ -38,6 +40,8 @@ public class CmsNavigationServiceImpl extends ServiceImpl pageRel(CmsNavigationParam param) { @@ -88,7 +92,11 @@ public class CmsNavigationServiceImpl extends ServiceImpl().eq(CmsPage::getPageId, navigation.getPageId()).last("limit 1")); + if (ObjectUtil.isNotEmpty(page) && StrUtil.isNotBlank(page.getPath())) { + navigation.setPath("/page/" + page.getPath()); + } + } + // 2.特例:默认首页 if (navigation.getPath().equals("/") || navigation.getModel().equals("index")) { final long count = count(new LambdaQueryWrapper().eq(CmsNavigation::getPath, "/").eq(CmsNavigation::getLang,navigation.getLang()));