From a081c762d6dd1dd7d956df55261bd75a6b278989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=9F=B3=E5=A4=B4?= Date: Sat, 28 Oct 2023 23:21:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=A7=9F=E6=88=B7=E4=B8=8D?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=BD=B1=E5=93=8D=E7=94=A8=E6=88=B7=E6=89=80?= =?UTF-8?q?=E6=8B=A5=E6=9C=89=E7=9A=84=E8=A7=92=E8=89=B2=E7=BB=84=EF=BC=8C?= =?UTF-8?q?=E8=80=8C=E5=BA=94=E8=AF=A5=E5=9C=A8=E9=AD=94=E6=96=B9=E9=87=8C?= =?UTF-8?q?=E9=9D=A2=E7=8B=AC=E7=AB=8B=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\347\224\250\346\210\267.Biz.cs" | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git "a/XCode/Membership/\347\224\250\346\210\267.Biz.cs" "b/XCode/Membership/\347\224\250\346\210\267.Biz.cs" index 5d09cd813..ef7d1ca62 100644 --- "a/XCode/Membership/\347\224\250\346\210\267.Biz.cs" +++ "b/XCode/Membership/\347\224\250\346\210\267.Biz.cs" @@ -88,9 +88,14 @@ public override void Valid(Boolean isNew) if (ids.Length > 0) { RoleID = ids[0]; - var str = ids.Skip(1).Join(); - if (!str.IsNullOrEmpty()) str = "," + str + ","; - RoleIds = str; + if (ids.Length == 1) + RoleIds = null; + else + { + var str = ids.Skip(1).Join(); + if (!str.IsNullOrEmpty()) str = "," + str + ","; + RoleIds = str; + } } // 自动计算年龄 @@ -607,15 +612,15 @@ private Boolean DisableAdmin() /// public virtual Int32[] GetRoleIDs() { - var tenantId = (TenantContext.Current?.TenantId).ToInt(-1); - if (tenantId > 0) - { - var tuEntity = TenantUser.FindByTenantIdAndUserId(tenantId, ID); - var idlist = RoleIds.SplitAsInt().OrderBy(e => e).ToList(); - if (tuEntity != null && tuEntity.RoleId > 0) idlist.Insert(0, tuEntity.RoleId); + //var tenantId = (TenantContext.Current?.TenantId).ToInt(-1); + //if (tenantId > 0) + //{ + // var tuEntity = TenantUser.FindByTenantIdAndUserId(tenantId, ID); + // var idlist = RoleIds.SplitAsInt().OrderBy(e => e).ToList(); + // if (tuEntity != null && tuEntity.RoleId > 0) idlist.Insert(0, tuEntity.RoleId); - return idlist.Distinct().ToArray(); - } + // return idlist.Distinct().ToArray(); + //} var ids = RoleIds.SplitAsInt().OrderBy(e => e).ToList(); if (RoleID > 0) ids.Insert(0, RoleID);