From 5b6e1be35b74adfd2c79ac4c9a20bd236da1dd6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Thu, 30 Jul 2026 18:59:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(cms):=20=E4=BF=AE=E5=A4=8D=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=9C=BA=E6=99=AF=E6=8E=A7=E5=88=B6=E5=99=A8=E7=BC=BA?= =?UTF-8?q?=E5=A4=B1tenantId=E5=AF=BC=E8=87=B4=E5=AF=BC=E8=88=AA=E6=9C=AA?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 编辑场景控制器未注入tenantId时从数据库获取原记录tenantId - 避免bindNavigation因tenantId为空导致无法命中数据行 - 确保导航关联数据正确写回数据库 - 提升编辑场景更新的稳定性和数据一致性 --- .../impl/CmsNavigationServiceImpl.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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()));