|
@@ -126,8 +126,8 @@ public class SysMenu extends BaseEntity {
|
|
|
* 内链域名特殊字符替换
|
|
* 内链域名特殊字符替换
|
|
|
*/
|
|
*/
|
|
|
public static String innerLinkReplaceEach(String path) {
|
|
public static String innerLinkReplaceEach(String path) {
|
|
|
- return StringUtils.replaceEach(path, new String[]{Constants.HTTP, Constants.HTTPS, Constants.WWW, ".", ":"},
|
|
|
|
|
- new String[]{"", "", "", "/", "/"});
|
|
|
|
|
|
|
+ return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS, Constants.WWW, ".", ":" },
|
|
|
|
|
+ new String[] { "", "", "", "/", "/" });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -148,11 +148,11 @@ public class SysMenu extends BaseEntity {
|
|
|
public String getRouterPath() {
|
|
public String getRouterPath() {
|
|
|
String routerPath = this.path;
|
|
String routerPath = this.path;
|
|
|
// 内链打开外网方式
|
|
// 内链打开外网方式
|
|
|
- if (getParentId() != 0L && isInnerLink()) {
|
|
|
|
|
|
|
+ if (!Constants.TOP_PARENT_ID.equals(getParentId()) && isInnerLink()) {
|
|
|
routerPath = innerLinkReplaceEach(routerPath);
|
|
routerPath = innerLinkReplaceEach(routerPath);
|
|
|
}
|
|
}
|
|
|
// 非外链并且是一级目录(类型为目录)
|
|
// 非外链并且是一级目录(类型为目录)
|
|
|
- if (0L == getParentId() && SystemConstants.TYPE_DIR.equals(getMenuType())
|
|
|
|
|
|
|
+ if (Constants.TOP_PARENT_ID.equals(getParentId()) && SystemConstants.TYPE_DIR.equals(getMenuType())
|
|
|
&& SystemConstants.NO_FRAME.equals(getIsFrame())) {
|
|
&& SystemConstants.NO_FRAME.equals(getIsFrame())) {
|
|
|
routerPath = "/" + this.path;
|
|
routerPath = "/" + this.path;
|
|
|
}
|
|
}
|
|
@@ -170,7 +170,8 @@ public class SysMenu extends BaseEntity {
|
|
|
String component = SystemConstants.LAYOUT;
|
|
String component = SystemConstants.LAYOUT;
|
|
|
if (StringUtils.isNotEmpty(this.component) && !isMenuFrame()) {
|
|
if (StringUtils.isNotEmpty(this.component) && !isMenuFrame()) {
|
|
|
component = this.component;
|
|
component = this.component;
|
|
|
- } else if (StringUtils.isEmpty(this.component) && getParentId() != 0L && isInnerLink()) {
|
|
|
|
|
|
|
+ } else if (StringUtils.isEmpty(this.component) && !Constants.TOP_PARENT_ID.equals(getParentId())
|
|
|
|
|
+ && isInnerLink()) {
|
|
|
component = SystemConstants.INNER_LINK;
|
|
component = SystemConstants.INNER_LINK;
|
|
|
} else if (StringUtils.isEmpty(this.component) && isParentView()) {
|
|
} else if (StringUtils.isEmpty(this.component) && isParentView()) {
|
|
|
component = SystemConstants.PARENT_VIEW;
|
|
component = SystemConstants.PARENT_VIEW;
|
|
@@ -182,7 +183,8 @@ public class SysMenu extends BaseEntity {
|
|
|
* 是否为菜单内部跳转
|
|
* 是否为菜单内部跳转
|
|
|
*/
|
|
*/
|
|
|
public boolean isMenuFrame() {
|
|
public boolean isMenuFrame() {
|
|
|
- return getParentId() == 0L && SystemConstants.TYPE_MENU.equals(menuType) && isFrame.equals(SystemConstants.NO_FRAME);
|
|
|
|
|
|
|
+ return Constants.TOP_PARENT_ID.equals(getParentId()) && SystemConstants.TYPE_MENU.equals(menuType)
|
|
|
|
|
+ && isFrame.equals(SystemConstants.NO_FRAME);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -196,6 +198,6 @@ public class SysMenu extends BaseEntity {
|
|
|
* 是否为parent_view组件
|
|
* 是否为parent_view组件
|
|
|
*/
|
|
*/
|
|
|
public boolean isParentView() {
|
|
public boolean isParentView() {
|
|
|
- return getParentId() != 0L && SystemConstants.TYPE_DIR.equals(menuType);
|
|
|
|
|
|
|
+ return !Constants.TOP_PARENT_ID.equals(getParentId()) && SystemConstants.TYPE_DIR.equals(menuType);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|