highway
zhaoxiaolin 1 year ago
parent 7bbdd00a61
commit 616d370067

@ -41,6 +41,8 @@ public class UserConstants {
/** 是否菜单外链(否) */
public static final String NO_FRAME = "1";
/** 菜单类型(应用系统) */
public static final String TYPE_APP = "A";
/** 菜单类型(目录) */
public static final String TYPE_DIR = "M";

@ -157,7 +157,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()),
menu.getPath()));
List<SysMenu> cMenus = menu.getChildren();
if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) {
if (!cMenus.isEmpty() && cMenus.size() > 0 && (UserConstants.TYPE_DIR.equals(menu.getMenuType()) || UserConstants.TYPE_APP.equals(menu.getMenuType()))) {
router.setAlwaysShow(true);
router.setRedirect("noRedirect");
router.setChildren(buildMenus(cMenus));
@ -339,7 +339,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
routerPath = innerLinkReplaceEach(routerPath);
}
// 非外链并且是一级目录(类型为目录)
if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType())
if (0 == menu.getParentId().intValue() && (UserConstants.TYPE_DIR.equals(menu.getMenuType()) || UserConstants.TYPE_APP.equals(menu.getMenuType()))
&& UserConstants.NO_FRAME.equals(menu.getIsFrame())) {
routerPath = "/" + menu.getPath();
}
@ -397,7 +397,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
* @return
*/
public boolean isParentView(SysMenu menu) {
return menu.getParentId().intValue() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType());
return menu.getParentId().intValue() != 0 && (UserConstants.TYPE_DIR.equals(menu.getMenuType()) || UserConstants.TYPE_APP.equals(menu.getMenuType()));
}
/**

@ -50,7 +50,7 @@
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.visible, m.status, isnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
from sys_menu m where m.menu_type in ('A','M', 'C') and m.status = 0
order by m.parent_id, m.order_num
</select>
@ -80,7 +80,7 @@
left join sys_user_role ur on rm.role_id = ur.role_id
left join sys_role ro on ur.role_id = ro.role_id
left join sys_user u on ur.user_id = u.user_id
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0
where u.user_id = #{userId} and m.menu_type in ('A','M', 'C') and m.status = 0 AND ro.status = 0
order by m.parent_id, m.order_num
</select>

Loading…
Cancel
Save