Li 2 år sedan
förälder
incheckning
1ffb13b401
1 ändrade filer med 3 tillägg och 0 borttagningar
  1. 3 0
      TEAMModelBI/Controllers/LoginController.cs

+ 3 - 0
TEAMModelBI/Controllers/LoginController.cs

@@ -214,6 +214,7 @@ namespace TEAMModelBI.Controllers
                         }
 
                         roles = !string.IsNullOrEmpty($"{item.roles}") ? new List<string>(item.roles.Split(",")) : new List<string>();
+                        roles = roles.Where(w => !string.IsNullOrEmpty(w)).ToList();
                         permissions = !string.IsNullOrEmpty($"{item.permissions}") ? new List<string>(item.permissions.Split(",")) : new List<string>();
                         if (item.depts.Contains($"{proDeptId}")) isExploit = true;
                         if (item.deptId == long.Parse($"{proDeptId}")) isExploit = true;
@@ -300,6 +301,7 @@ namespace TEAMModelBI.Controllers
                     await AzureStorageBlobExtensions.SaveBILog(blobClient, tableClient, "tabledd-update", $"{ddUserInfo.tmdName}【{ddUserInfo.tmdId}】醍摩豆账号和{ddUserInfo.name}【{ddUserInfo.RowKey}】钉钉账户绑定成功", _dingDing, httpContext: HttpContext, tid: ddUserInfo.tmdId, tname: ddUserInfo.tmdName, twebsite: Website);
 
                     roles = !string.IsNullOrEmpty($"{ddUserInfo.roles}") ? new List<string>(ddUserInfo.roles.Split(",")) : new List<string>();
+                    roles = roles.Where(w => !string.IsNullOrEmpty(w)).ToList();
                     permissions = !string.IsNullOrEmpty($"{ddUserInfo.permissions}") ? new List<string>(ddUserInfo.permissions.Split(",")) : new List<string>();
                     if (ddUserInfo.depts.Contains($"{proDeptId}")) isExploit = true;
                     if (ddUserInfo.deptId == long.Parse($"{proDeptId}")) isExploit = true;
@@ -421,6 +423,7 @@ namespace TEAMModelBI.Controllers
                     {
                         ddUserInfos.Add(itemUser);
                         roles = !string.IsNullOrEmpty($"{itemUser.roles}") ? new List<string>(itemUser.roles.Split(",")) : new List<string>();
+                        roles = roles.Where(w => !string.IsNullOrEmpty(w)).ToList();
 
                         //保存操作记录
                         //await _azureStorage.SaveBILog("tabledd-update", $"{itemUser.tmdName}【{itemUser.tmdId}】醍摩豆账号和{itemUser.name}【{itemUser.userId}】钉钉账户绑定成功", _dingDing, tid: itemUser.tmdId, tname: itemUser.name, twebsite: Website, httpContext: HttpContext);