dss 2 lat temu
rodzic
commit
50427bcc4d

+ 1 - 1
src/Hotline.Api/Controllers/RoleController.cs

@@ -224,7 +224,7 @@ public class RoleController : BaseController
     [HttpGet("getdataauthoritybyrole")]
     public async Task<IReadOnlyList<SystemDataAuthority>> GetDataAuthorityByRole(string roleid)
     {
-        return await _systemDataAuthorityRepository.QueryAsync(x => x.RoleId == roleid);
+        return await _systemDataAuthorityRepository.Queryable().Where(x => x.RoleId == roleid).Includes(x => x.Table).Includes(x => x.Role).ToListAsync();
     }
 
     #endregion

+ 9 - 1
src/Hotline/Settings/SystemDataAuthority.cs

@@ -1,5 +1,8 @@
-using Hotline.Share.Enums.Settings;
+using Hotline.Identity.Roles;
+using Hotline.Share.Enums.Settings;
+using SqlSugar;
 using System.ComponentModel;
+using System.Security.Cryptography;
 using XF.Domain.Entities;
 using XF.Domain.Repository;
 
@@ -13,6 +16,9 @@ namespace Hotline.Settings
         /// </summary>
         public string RoleId { get; set; }
 
+        [Navigate(NavigateType.OneToOne, nameof(RoleId))]
+        public Role Role { get; set; }
+
         /// <summary>
         /// 角色Code
         /// </summary>
@@ -29,5 +35,7 @@ namespace Hotline.Settings
         public string TableId { get; set; }
 
 
+        [Navigate(NavigateType.OneToOne, nameof(TableId))]
+        public SystemDataTable Table { get; set; }
     }
 }