diff --git a/ruoyi-common/ruoyi-common-doc/src/main/java/org/dromara/common/doc/config/SpringDocConfig.java b/ruoyi-common/ruoyi-common-doc/src/main/java/org/dromara/common/doc/config/SpringDocConfig.java index 74f9b73b0..ae5ce362a 100644 --- a/ruoyi-common/ruoyi-common-doc/src/main/java/org/dromara/common/doc/config/SpringDocConfig.java +++ b/ruoyi-common/ruoyi-common-doc/src/main/java/org/dromara/common/doc/config/SpringDocConfig.java @@ -110,7 +110,7 @@ public class SpringDocConfig { public OpenApiCustomizer openApiCustomizer() { String contextPath = serverProperties.getServlet().getContextPath(); String finalContextPath; - if (StringUtils.isBlank(contextPath) || "/".equals(contextPath)) { + if (StringUtils.isBlank(contextPath) || StringUtils.SLASH.equals(contextPath)) { finalContextPath = ""; } else { finalContextPath = contextPath; diff --git a/ruoyi-modules/ruoyi-gen/src/main/java/org/dromara/gen/service/GenTableServiceImpl.java b/ruoyi-modules/ruoyi-gen/src/main/java/org/dromara/gen/service/GenTableServiceImpl.java index 1572b8cfe..c6e5b2888 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/java/org/dromara/gen/service/GenTableServiceImpl.java +++ b/ruoyi-modules/ruoyi-gen/src/main/java/org/dromara/gen/service/GenTableServiceImpl.java @@ -610,7 +610,7 @@ public class GenTableServiceImpl implements IGenTableService { */ public static String getGenPath(GenTable table, String template) { String genPath = table.getGenPath(); - if (StringUtils.equals(genPath, "/")) { + if (StringUtils.equals(genPath, StringUtils.SLASH)) { return System.getProperty("user.dir") + File.separator + "src" + File.separator + TemplateEngineUtils.getFileName(template, table); } return genPath + File.separator + TemplateEngineUtils.getFileName(template, table); diff --git a/ruoyi-modules/ruoyi-gen/src/main/java/org/dromara/gen/util/TemplateEngineUtils.java b/ruoyi-modules/ruoyi-gen/src/main/java/org/dromara/gen/util/TemplateEngineUtils.java index b9d0f39b8..ec738a0de 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/java/org/dromara/gen/util/TemplateEngineUtils.java +++ b/ruoyi-modules/ruoyi-gen/src/main/java/org/dromara/gen/util/TemplateEngineUtils.java @@ -202,8 +202,8 @@ public class TemplateEngineUtils { // 业务名称 String businessName = genTable.getBusinessName(); - String javaPath = PROJECT_PATH + "/" + StringUtils.replace(packageName, ".", "/"); - String mybatisPath = MYBATIS_PATH + "/" + moduleName; + String javaPath = PROJECT_PATH + StringUtils.SLASH + StringUtils.replace(packageName, ".", StringUtils.SLASH); + String mybatisPath = MYBATIS_PATH + StringUtils.SLASH + moduleName; String vuePath = "vue"; // templatePath // genFilePathFormat diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysMenu.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysMenu.java index 93368886d..65b2d9d2f 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysMenu.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/SysMenu.java @@ -136,11 +136,11 @@ public class SysMenu extends BaseEntity { // 非外链并且是一级目录(类型为目录) if (Constants.TOP_PARENT_ID.equals(getParentId()) && SystemConstants.TYPE_DIR.equals(getMenuType()) && SystemConstants.NO.equals(getIsFrame())) { - routerPath = "/" + this.path; + routerPath = StringUtils.SLASH + this.path; } // 非外链并且是一级目录(类型为菜单) else if (isMenuFrame()) { - routerPath = "/"; + routerPath = StringUtils.SLASH; } return routerPath; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/MetaVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/MetaVo.java index 5c5c98c0d..720900c68 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/MetaVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/MetaVo.java @@ -70,7 +70,7 @@ public class MetaVo { if (StringUtils.ishttp(link)) { this.link = link; } - if (StringUtils.startWithAnyIgnoreCase(activeMenu, "/")) { + if (StringUtils.startWithAnyIgnoreCase(activeMenu, StringUtils.SLASH)) { this.activeMenu = activeMenu; } } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/listener/DeptExcelConverter.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/listener/DeptExcelConverter.java index bbba2ec9a..288de1f14 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/listener/DeptExcelConverter.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/listener/DeptExcelConverter.java @@ -50,7 +50,7 @@ public class DeptExcelConverter implements Converter { Map> deptPathToTreeMap = TreeBuildUtils.buildTreeNodeMap( SpringUtils.getBean(ISysDeptService.class).selectDeptTreeList(new SysDeptBo()), - "/", + StringUtils.SLASH, Tree::getName ); diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/listener/DeptExcelOptions.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/listener/DeptExcelOptions.java index 8abcd0456..30b7f3b76 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/listener/DeptExcelOptions.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/listener/DeptExcelOptions.java @@ -2,6 +2,7 @@ package org.dromara.system.listener; import cn.hutool.core.lang.tree.Tree; import lombok.RequiredArgsConstructor; +import org.dromara.common.core.utils.StringUtils; import org.dromara.common.core.utils.TreeBuildUtils; import org.dromara.common.excel.core.ExcelOptionsProvider; import org.dromara.system.domain.bo.SysDeptBo; @@ -31,7 +32,7 @@ public class DeptExcelOptions implements ExcelOptionsProvider { @Override public Set getOptions() { List> trees = deptService.selectDeptTreeList(new SysDeptBo()); - Map> treeMap = TreeBuildUtils.buildTreeNodeMap(trees, "/", Tree::getName); + Map> treeMap = TreeBuildUtils.buildTreeNodeMap(trees, StringUtils.SLASH, Tree::getName); return treeMap.keySet(); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysMenuServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysMenuServiceImpl.java index f60ea03e9..fd42da8e5 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysMenuServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysMenuServiceImpl.java @@ -187,7 +187,7 @@ public class SysMenuServiceImpl implements ISysMenuService { router.setChildren(childrenList); } else if (menu.getParentId().equals(Constants.TOP_PARENT_ID) && menu.isInnerLink()) { router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); - router.setPath("/"); + router.setPath(StringUtils.SLASH); List childrenList = new ArrayList<>(); RouterVo children = new RouterVo(); String routerPath = SysMenu.innerLinkReplaceEach(menu.getPath());