|
|
|
@ -26,6 +26,8 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 描述: 功能点管理
|
|
|
|
|
*
|
|
|
|
@ -189,6 +191,11 @@ public class FunctionController {
|
|
|
|
|
return JsonResult.success(tree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 当前登录用户的权限ID集合
|
|
|
|
|
*/
|
|
|
|
|
private static final ThreadLocal<String> currentUserRoleIds = ThreadLocal.withInitial(() -> null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<FunctionNodeView> buildFunctionTree(FunctionItem node){
|
|
|
|
|
List<FunctionItem> list = node.getChildren();
|
|
|
|
@ -196,8 +203,14 @@ public class FunctionController {
|
|
|
|
|
return Collections.EMPTY_LIST;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CoreUser currentUser = platformService.getCurrentUser();
|
|
|
|
|
String ids = functionConsoleService.getFunctionIdByUser(currentUser.getId());
|
|
|
|
|
if(currentUserRoleIds.get() == null) {
|
|
|
|
|
CoreUser user = getUser();
|
|
|
|
|
// 非管理员,才查询权限ID.避免数据量过大,数据库压力大
|
|
|
|
|
if(!user.isAdmin()) {
|
|
|
|
|
currentUserRoleIds.set(functionConsoleService.getFunctionIdByUser(user.getId()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String ids = currentUserRoleIds.get();
|
|
|
|
|
|
|
|
|
|
List<FunctionNodeView> views = new ArrayList<FunctionNodeView>(list.size());
|
|
|
|
|
for(FunctionItem item :list){
|
|
|
|
|