mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2026-05-01 23:44:27 +08:00
update 使用 StringUtils.SLASH 替代硬编码的斜杠
This commit is contained in:
@@ -110,7 +110,7 @@ public class SpringDocConfig {
|
|||||||
public OpenApiCustomizer openApiCustomizer() {
|
public OpenApiCustomizer openApiCustomizer() {
|
||||||
String contextPath = serverProperties.getServlet().getContextPath();
|
String contextPath = serverProperties.getServlet().getContextPath();
|
||||||
String finalContextPath;
|
String finalContextPath;
|
||||||
if (StringUtils.isBlank(contextPath) || "/".equals(contextPath)) {
|
if (StringUtils.isBlank(contextPath) || StringUtils.SLASH.equals(contextPath)) {
|
||||||
finalContextPath = "";
|
finalContextPath = "";
|
||||||
} else {
|
} else {
|
||||||
finalContextPath = contextPath;
|
finalContextPath = contextPath;
|
||||||
|
|||||||
@@ -610,7 +610,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
|||||||
*/
|
*/
|
||||||
public static String getGenPath(GenTable table, String template) {
|
public static String getGenPath(GenTable table, String template) {
|
||||||
String genPath = table.getGenPath();
|
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 System.getProperty("user.dir") + File.separator + "src" + File.separator + TemplateEngineUtils.getFileName(template, table);
|
||||||
}
|
}
|
||||||
return genPath + File.separator + TemplateEngineUtils.getFileName(template, table);
|
return genPath + File.separator + TemplateEngineUtils.getFileName(template, table);
|
||||||
|
|||||||
@@ -202,8 +202,8 @@ public class TemplateEngineUtils {
|
|||||||
// 业务名称
|
// 业务名称
|
||||||
String businessName = genTable.getBusinessName();
|
String businessName = genTable.getBusinessName();
|
||||||
|
|
||||||
String javaPath = PROJECT_PATH + "/" + StringUtils.replace(packageName, ".", "/");
|
String javaPath = PROJECT_PATH + StringUtils.SLASH + StringUtils.replace(packageName, ".", StringUtils.SLASH);
|
||||||
String mybatisPath = MYBATIS_PATH + "/" + moduleName;
|
String mybatisPath = MYBATIS_PATH + StringUtils.SLASH + moduleName;
|
||||||
String vuePath = "vue";
|
String vuePath = "vue";
|
||||||
// templatePath
|
// templatePath
|
||||||
// genFilePathFormat
|
// genFilePathFormat
|
||||||
|
|||||||
@@ -136,11 +136,11 @@ public class SysMenu extends BaseEntity {
|
|||||||
// 非外链并且是一级目录(类型为目录)
|
// 非外链并且是一级目录(类型为目录)
|
||||||
if (Constants.TOP_PARENT_ID.equals(getParentId()) && SystemConstants.TYPE_DIR.equals(getMenuType())
|
if (Constants.TOP_PARENT_ID.equals(getParentId()) && SystemConstants.TYPE_DIR.equals(getMenuType())
|
||||||
&& SystemConstants.NO.equals(getIsFrame())) {
|
&& SystemConstants.NO.equals(getIsFrame())) {
|
||||||
routerPath = "/" + this.path;
|
routerPath = StringUtils.SLASH + this.path;
|
||||||
}
|
}
|
||||||
// 非外链并且是一级目录(类型为菜单)
|
// 非外链并且是一级目录(类型为菜单)
|
||||||
else if (isMenuFrame()) {
|
else if (isMenuFrame()) {
|
||||||
routerPath = "/";
|
routerPath = StringUtils.SLASH;
|
||||||
}
|
}
|
||||||
return routerPath;
|
return routerPath;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class MetaVo {
|
|||||||
if (StringUtils.ishttp(link)) {
|
if (StringUtils.ishttp(link)) {
|
||||||
this.link = link;
|
this.link = link;
|
||||||
}
|
}
|
||||||
if (StringUtils.startWithAnyIgnoreCase(activeMenu, "/")) {
|
if (StringUtils.startWithAnyIgnoreCase(activeMenu, StringUtils.SLASH)) {
|
||||||
this.activeMenu = activeMenu;
|
this.activeMenu = activeMenu;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class DeptExcelConverter implements Converter<Long> {
|
|||||||
|
|
||||||
Map<String, Tree<Long>> deptPathToTreeMap = TreeBuildUtils.buildTreeNodeMap(
|
Map<String, Tree<Long>> deptPathToTreeMap = TreeBuildUtils.buildTreeNodeMap(
|
||||||
SpringUtils.getBean(ISysDeptService.class).selectDeptTreeList(new SysDeptBo()),
|
SpringUtils.getBean(ISysDeptService.class).selectDeptTreeList(new SysDeptBo()),
|
||||||
"/",
|
StringUtils.SLASH,
|
||||||
Tree::getName
|
Tree::getName
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.dromara.system.listener;
|
|||||||
|
|
||||||
import cn.hutool.core.lang.tree.Tree;
|
import cn.hutool.core.lang.tree.Tree;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.utils.TreeBuildUtils;
|
import org.dromara.common.core.utils.TreeBuildUtils;
|
||||||
import org.dromara.common.excel.core.ExcelOptionsProvider;
|
import org.dromara.common.excel.core.ExcelOptionsProvider;
|
||||||
import org.dromara.system.domain.bo.SysDeptBo;
|
import org.dromara.system.domain.bo.SysDeptBo;
|
||||||
@@ -31,7 +32,7 @@ public class DeptExcelOptions implements ExcelOptionsProvider {
|
|||||||
@Override
|
@Override
|
||||||
public Set<String> getOptions() {
|
public Set<String> getOptions() {
|
||||||
List<Tree<Long>> trees = deptService.selectDeptTreeList(new SysDeptBo());
|
List<Tree<Long>> trees = deptService.selectDeptTreeList(new SysDeptBo());
|
||||||
Map<String, Tree<Long>> treeMap = TreeBuildUtils.buildTreeNodeMap(trees, "/", Tree::getName);
|
Map<String, Tree<Long>> treeMap = TreeBuildUtils.buildTreeNodeMap(trees, StringUtils.SLASH, Tree::getName);
|
||||||
return treeMap.keySet();
|
return treeMap.keySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
|||||||
router.setChildren(childrenList);
|
router.setChildren(childrenList);
|
||||||
} else if (menu.getParentId().equals(Constants.TOP_PARENT_ID) && menu.isInnerLink()) {
|
} else if (menu.getParentId().equals(Constants.TOP_PARENT_ID) && menu.isInnerLink()) {
|
||||||
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon()));
|
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon()));
|
||||||
router.setPath("/");
|
router.setPath(StringUtils.SLASH);
|
||||||
List<RouterVo> childrenList = new ArrayList<>();
|
List<RouterVo> childrenList = new ArrayList<>();
|
||||||
RouterVo children = new RouterVo();
|
RouterVo children = new RouterVo();
|
||||||
String routerPath = SysMenu.innerLinkReplaceEach(menu.getPath());
|
String routerPath = SysMenu.innerLinkReplaceEach(menu.getPath());
|
||||||
|
|||||||
Reference in New Issue
Block a user