| | |
| | | RouterVo children = new RouterVo();
|
| | | children.setPath(menu.getPath());
|
| | | children.setComponent(menu.getComponent());
|
| | | children.setName(StringUtils.capitalize(menu.getPath()));
|
| | | children.setName(getRouteName(menu.getRouteName(), menu.getPath()));
|
| | | children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
|
| | | children.setQuery(menu.getQuery());
|
| | | childrenList.add(children);
|
| | |
| | | String routerPath = innerLinkReplaceEach(menu.getPath());
|
| | | children.setPath(routerPath);
|
| | | children.setComponent(UserConstants.INNER_LINK);
|
| | | children.setName(StringUtils.capitalize(routerPath));
|
| | | children.setName(getRouteName(menu.getRouteName(), routerPath));
|
| | | children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), menu.getPath()));
|
| | | childrenList.add(children);
|
| | | router.setChildren(childrenList);
|
| | |
| | | */
|
| | | public String getRouteName(SysMenu menu)
|
| | | {
|
| | | String routerName = StringUtils.capitalize(menu.getPath());
|
| | | // 非外链并且是一级目录(类型为目录)
|
| | | if (isMenuFrame(menu))
|
| | | {
|
| | | routerName = StringUtils.EMPTY;
|
| | | return StringUtils.EMPTY;
|
| | | }
|
| | | return routerName;
|
| | | return getRouteName(menu.getRouteName(), menu.getPath());
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取路由名称,如没有配置路由名称则取路由地址
|
| | | * |
| | | * @param routerName 路由名称
|
| | | * @param path 路由地址
|
| | | * @return 路由名称(驼峰格式)
|
| | | */
|
| | | public String getRouteName(String name, String path)
|
| | | {
|
| | | String routerName = StringUtils.isNotEmpty(name) ? name : path;
|
| | | return StringUtils.capitalize(routerName);
|
| | | }
|
| | |
|
| | | /**
|