diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/IServices/IRoleService.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/IServices/IRoleService.cs
index df48ee92..7fb9d25d 100644
--- a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/IServices/IRoleService.cs
+++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/IServices/IRoleService.cs
@@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Services;
using Yi.Framework.Ddd.Application.Contracts;
using Yi.Framework.Rbac.Application.Contracts.Dtos.Role;
+using Yi.Framework.Rbac.Domain.Shared.Enums;
namespace Yi.Framework.Rbac.Application.Contracts.IServices
{
@@ -15,7 +16,7 @@ namespace Yi.Framework.Rbac.Application.Contracts.IServices
///
/// 角色ID
/// 角色菜单树数据,包含已选中的菜单ID和菜单树结构
- Task GetMenuTreeAsync(Guid roleId);
+ Task GetMenuTreeAsync(Guid roleId,MenuSourceEnum menuSource);
///
/// 获取角色部门树
diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/System/RoleService.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/System/RoleService.cs
index 9f6fb7bb..280b5345 100644
--- a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/System/RoleService.cs
+++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/System/RoleService.cs
@@ -227,12 +227,12 @@ namespace Yi.Framework.Rbac.Application.Services.System
///
///
///
- public async Task GetMenuTreeAsync(Guid roleId)
+ public async Task GetMenuTreeAsync(Guid roleId, MenuSourceEnum menuSource = MenuSourceEnum.Vben5)
{
var checkedKeys = await _menuRepository._DbQueryable
.Where(m => SqlFunc.Subqueryable().Where(rm => rm.RoleId == roleId && rm.MenuId == m.Id).Any())
.Select(x => x.Id).ToListAsync();
- var menus = await _menuRepository._DbQueryable.ToListAsync();
+ var menus = await _menuRepository._DbQueryable.Where(x => x.State == true && x.MenuSource == menuSource).ToListAsync();
var menuTrees = menus.TreeDtoBuild();
return new JsonResult(new
{
diff --git a/Yi.Vben5.Vue3/apps/web-antd/src/api/system/role/index.ts b/Yi.Vben5.Vue3/apps/web-antd/src/api/system/role/index.ts
index 1d8c84eb..7046e1fd 100644
--- a/Yi.Vben5.Vue3/apps/web-antd/src/api/system/role/index.ts
+++ b/Yi.Vben5.Vue3/apps/web-antd/src/api/system/role/index.ts
@@ -157,5 +157,5 @@ export function roleDeptTree(roleId: ID) {
* @returns resp
*/
export function roleMenuTreeSelect(roleId: ID) {
- return requestClient.get(`${Api.roleMenuTree}/${roleId}`);
+ return requestClient.get(`${Api.roleMenuTree}/${roleId}?menuSource=Vben5`);
}