浏览代码

优化租户初始化数据排序值

zhontai 2 年之前
父节点
当前提交
f13f5d98b6
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      src/platform/ZhonTai.Admin/Services/Tenant/TenantService.cs

+ 6 - 3
src/platform/ZhonTai.Admin/Services/Tenant/TenantService.cs

@@ -109,7 +109,8 @@ public class TenantService : BaseService, ITenantService, IDynamicApi
             Name = input.Name,
             Name = input.Name,
             Code = input.Code,
             Code = input.Code,
             ParentId = 0,
             ParentId = 0,
-            MemberCount = 1
+            MemberCount = 1,
+            Sort = 1
         };
         };
         await _orgRepository.InsertAsync(org);
         await _orgRepository.InsertAsync(org);
 
 
@@ -153,7 +154,8 @@ public class TenantService : BaseService, ITenantService, IDynamicApi
             ParentId = 0,
             ParentId = 0,
             TenantId = tenantId,
             TenantId = tenantId,
             Type = RoleType.Group,
             Type = RoleType.Group,
-            Name = "系统默认"
+            Name = "系统默认",
+            Sort = 1
         };
         };
         await _roleRepository.InsertAsync(roleGroup);
         await _roleRepository.InsertAsync(roleGroup);
 
 
@@ -165,7 +167,8 @@ public class TenantService : BaseService, ITenantService, IDynamicApi
             Name = "主管理员",
             Name = "主管理员",
             Code = "main-admin",
             Code = "main-admin",
             ParentId = roleGroup.Id,
             ParentId = roleGroup.Id,
-            DataScope = DataScope.All
+            DataScope = DataScope.All,
+            Sort = 1
         };
         };
         await _roleRepository.InsertAsync(role);
         await _roleRepository.InsertAsync(role);