|
@@ -216,12 +216,10 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|
router.setPath(menu.getPath());
|
|
router.setPath(menu.getPath());
|
|
List<SysMenu> cMenus = menu.getChildren();
|
|
List<SysMenu> cMenus = menu.getChildren();
|
|
if (isParent){
|
|
if (isParent){
|
|
- if (cMenus.size() == 1){
|
|
|
|
- router.setRedirect(menu.getPath());
|
|
|
|
- }else if (cMenus.size() > 1){
|
|
|
|
- router.setRedirect(menu.getPath()+"/"+cMenus.get(0).getPath());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ String redirect = cMenus.get(0).getComponent();
|
|
|
|
+ Integer index = redirect.indexOf("/",2);
|
|
|
|
+ redirect =redirect.substring(index,redirect.length());
|
|
|
|
+ router.setRedirect(redirect);
|
|
if (0 == affix){
|
|
if (0 == affix){
|
|
metaVo.setAffix(true);
|
|
metaVo.setAffix(true);
|
|
}
|
|
}
|
|
@@ -233,6 +231,13 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|
return router;
|
|
return router;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
+ String url = "@/a/b/c/d/e";
|
|
|
|
+ Integer index = url.indexOf("/",2);
|
|
|
|
+ url =url.substring(index,url.length());
|
|
|
|
+ System.out.println(url);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 构建前端所需要树结构
|
|
* 构建前端所需要树结构
|
|
*
|
|
*
|