修复bug:比如只给租户角色的菜单里面的基础资料赋予供应商的菜单,然后用租户去登录,再去给下级用户赋予菜单的时候,发现没有基础资料这个大菜单
This commit is contained in:
@@ -241,7 +241,7 @@ public class FunctionController extends BaseController {
|
|||||||
if("admin".equals(userInfo.getLoginName())) {
|
if("admin".equals(userInfo.getLoginName())) {
|
||||||
funIdList = null;
|
funIdList = null;
|
||||||
}
|
}
|
||||||
List<Function> dataListFun = functionService.findRoleFunction("0", funIdList);
|
List<Function> dataListFun = functionService.findRoleFunction("0", null);
|
||||||
//开始拼接json数据
|
//开始拼接json数据
|
||||||
JSONObject outer = new JSONObject();
|
JSONObject outer = new JSONObject();
|
||||||
outer.put("id", 0);
|
outer.put("id", 0);
|
||||||
@@ -255,17 +255,22 @@ public class FunctionController extends BaseController {
|
|||||||
//根据条件从列表里面移除"系统管理"
|
//根据条件从列表里面移除"系统管理"
|
||||||
List<Function> dataList = new ArrayList<>();
|
List<Function> dataList = new ArrayList<>();
|
||||||
for (Function fun : dataListFun) {
|
for (Function fun : dataListFun) {
|
||||||
|
List<Function> childrenList = functionService.getRoleFunction(fun.getNumber());
|
||||||
String token = request.getHeader("X-Access-Token");
|
String token = request.getHeader("X-Access-Token");
|
||||||
Long tenantId = Tools.getTenantIdByToken(token);
|
Long tenantId = Tools.getTenantIdByToken(token);
|
||||||
if (tenantId!=0L) {
|
if (tenantId!=0L) {
|
||||||
if(!("系统管理").equals(fun.getName())) {
|
if(!("系统管理").equals(fun.getName())) {
|
||||||
|
if(!childrenList.isEmpty()) {
|
||||||
dataList.add(fun);
|
dataList.add(fun);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//超管
|
//超管
|
||||||
|
if(!childrenList.isEmpty()) {
|
||||||
dataList.add(fun);
|
dataList.add(fun);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
dataArray = getFunctionList(dataList, type, keyId, funIdList);
|
dataArray = getFunctionList(dataList, type, keyId, funIdList);
|
||||||
outer.put("children", dataArray);
|
outer.put("children", dataArray);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user