授权首页菜单后,自定义首页功能不生效 #3069

This commit is contained in:
zhangdaiscott
2021-10-16 19:41:55 +08:00
parent 6fb01abbc5
commit ef97f700ab
2 changed files with 37 additions and 18 deletions

View File

@ -1,5 +1,7 @@
package org.jeecg.common.constant.enums;
import java.util.List;
/**
* 首页自定义
* 通过角色编码与首页组件路径配置
@ -64,6 +66,17 @@ public enum RoleIndexConfigEnum {
return null;
}
public static String getIndexByRoles(List<String> roles) {
for (String role : roles) {
for (RoleIndexConfigEnum e : RoleIndexConfigEnum.values()) {
if (e.roleCode.equals(role)) {
return e.componentUrl;
}
}
}
return null;
}
public String getRoleCode() {
return roleCode;
}