mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2026-04-06 03:04:27 +08:00
Compare commits
2 Commits
future/6.X
...
futuer/boo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
957b1edd18 | ||
|
|
11d392fb73 |
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class DeptExcelConverter implements Converter<Long> {
|
||||
|
||||
Map<String, Tree<Long>> deptPathToTreeMap = TreeBuildUtils.buildTreeNodeMap(
|
||||
SpringUtils.getBean(ISysDeptService.class).selectDeptTreeList(new SysDeptBo()),
|
||||
"/",
|
||||
StringUtils.SLASH,
|
||||
Tree::getName
|
||||
);
|
||||
|
||||
|
||||
@@ -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<String> getOptions() {
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu, SysMenuVo>, MPJBa
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户ID查询菜单
|
||||
* 查询正常状态下的全部的菜单和目录
|
||||
*
|
||||
* @return 菜单列表
|
||||
*/
|
||||
@@ -129,6 +129,13 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu, SysMenuVo>, MPJBa
|
||||
.toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件查询当前用户的菜单列表
|
||||
*
|
||||
* @param menu 菜单筛选条件
|
||||
* @param userId 用户ID
|
||||
* @return 菜单列表
|
||||
*/
|
||||
default List<SysMenuVo> selectMenuListByUserId(SysMenuBo menu, Long userId) {
|
||||
return this.selectJoinList(SysMenuVo.class, JoinWrappers.lambda("m", SysMenu.class)
|
||||
.distinct()
|
||||
@@ -147,6 +154,12 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu, SysMenuVo>, MPJBa
|
||||
.orderByAsc("m", SysMenu::getOrderNum));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前用户的菜单树数据
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 菜单列表
|
||||
*/
|
||||
default List<SysMenu> selectMenuTreeByUserId(Long userId) {
|
||||
return this.selectJoinList(SysMenu.class, JoinWrappers.lambda("m", SysMenu.class)
|
||||
.distinct()
|
||||
|
||||
@@ -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<RouterVo> childrenList = new ArrayList<>();
|
||||
RouterVo children = new RouterVo();
|
||||
String routerPath = SysMenu.innerLinkReplaceEach(menu.getPath());
|
||||
|
||||
Reference in New Issue
Block a user