菜单新增是否缓存keep-alive
This commit is contained in:
		| @@ -17,6 +17,11 @@ public class MetaVo | ||||
|      */ | ||||
|     private String icon; | ||||
|  | ||||
|     /** | ||||
|      * 设置为true,则不会被 <keep-alive>缓存 | ||||
|      */ | ||||
|     private boolean noCache; | ||||
|  | ||||
|     public MetaVo() | ||||
|     { | ||||
|     } | ||||
| @@ -27,6 +32,23 @@ public class MetaVo | ||||
|         this.icon = icon; | ||||
|     } | ||||
|  | ||||
|     public MetaVo(String title, String icon, boolean noCache) | ||||
|     { | ||||
|         this.title = title; | ||||
|         this.icon = icon; | ||||
|         this.noCache = noCache; | ||||
|     } | ||||
|  | ||||
|     public boolean isNoCache() | ||||
|     { | ||||
|         return noCache; | ||||
|     } | ||||
|  | ||||
|     public void setNoCache(boolean noCache) | ||||
|     { | ||||
|         this.noCache = noCache; | ||||
|     } | ||||
|  | ||||
|     public String getTitle() | ||||
|     { | ||||
|         return title; | ||||
|   | ||||
| @@ -150,7 +150,7 @@ public class SysMenuServiceImpl implements ISysMenuService | ||||
|             router.setName(getRouteName(menu)); | ||||
|             router.setPath(getRouterPath(menu)); | ||||
|             router.setComponent(getComponent(menu)); | ||||
|             router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); | ||||
|             router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()))); | ||||
|             List<SysMenu> cMenus = menu.getChildren(); | ||||
|             if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) | ||||
|             { | ||||
| @@ -165,7 +165,7 @@ public class SysMenuServiceImpl implements ISysMenuService | ||||
|                 children.setPath(menu.getPath()); | ||||
|                 children.setComponent(menu.getComponent()); | ||||
|                 children.setName(StringUtils.capitalize(menu.getPath())); | ||||
|                 children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); | ||||
|                 children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()))); | ||||
|                 childrenList.add(children); | ||||
|                 router.setChildren(childrenList); | ||||
|             } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user