highway
zhaoxiaolin 1 year ago
parent 7bbdd00a61
commit 616d370067

@ -2,7 +2,7 @@ package com.op.common.core.constant;
/**
*
*
*
* @author OP
*/
public class UserConstants {
@ -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";

@ -27,7 +27,7 @@ import com.op.system.service.ISysMenuService;
/**
*
*
*
* @author OP
*/
@Service
@ -45,7 +45,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
*
*
*
* @param userId ID
* @return
*/
@ -56,7 +56,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
*
*
*
* @param menu
* @return
*/
@ -75,7 +75,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
* ID
*
*
* @param userId ID
* @return
*/
@ -93,7 +93,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
* ID
*
*
* @param roleId ID
* @return
*/
@ -111,7 +111,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
* ID
*
*
* @param userId
* @return
*/
@ -128,7 +128,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
* ID
*
*
* @param roleId ID
* @return
*/
@ -140,7 +140,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
*
*
*
* @param menus
* @return
*/
@ -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));
@ -193,7 +193,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
*
*
*
* @param menus
* @return
*/
@ -217,7 +217,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
*
*
*
* @param menus
* @return
*/
@ -229,7 +229,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
* ID
*
*
* @param menuId ID
* @return
*/
@ -240,7 +240,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
*
*
*
* @param menuId ID
* @return
*/
@ -252,7 +252,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
* 使
*
*
* @param menuId ID
* @return
*/
@ -264,7 +264,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
*
*
*
* @param menu
* @return
*/
@ -275,7 +275,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
*
*
*
* @param menu
* @return
*/
@ -286,7 +286,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
*
*
*
* @param menuId ID
* @return
*/
@ -297,7 +297,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
*
*
*
* @param menu
* @return
*/
@ -313,7 +313,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
*
*
*
* @param menu
* @return
*/
@ -328,7 +328,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
*
*
*
* @param menu
* @return
*/
@ -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();
}
@ -352,7 +352,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
*
*
*
* @param menu
* @return
*/
@ -371,7 +371,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
*
*
*
* @param menu
* @return
*/
@ -382,7 +382,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
*
*
*
* @param menu
* @return
*/
@ -392,17 +392,17 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
* parent_view
*
*
* @param menu
* @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()));
}
/**
* ID
*
*
* @param list
* @param parentId ID
* @return String
@ -422,7 +422,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
*
*
*
* @param list
* @param t
*/
@ -461,7 +461,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
*
*
*
* @return
*/
public String innerLinkReplaceEach(String path) {

@ -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