Преглед на файлове

update用户关联/移除企业信息接口

Li преди 2 години
родител
ревизия
2ce42be7ff
променени са 1 файла, в които са добавени 10 реда и са изтрити 4 реда
  1. 10 4
      TEAMModelBI/Controllers/BINormal/BusinessUsersController.cs

+ 10 - 4
TEAMModelBI/Controllers/BINormal/BusinessUsersController.cs

@@ -222,7 +222,7 @@ namespace TEAMModelBI.Controllers.BINormal
             if(!jsonElement.TryGetProperty("id", out JsonElement _id)) return BadRequest();
             if(!jsonElement.TryGetProperty("id", out JsonElement _id)) return BadRequest();
             if (!jsonElement.TryGetProperty("bizs", out JsonElement _bizs)) return BadRequest();
             if (!jsonElement.TryGetProperty("bizs", out JsonElement _bizs)) return BadRequest();
             if (!jsonElement.TryGetProperty("type", out JsonElement type)) return BadRequest();
             if (!jsonElement.TryGetProperty("type", out JsonElement type)) return BadRequest();
-            if (!jsonElement.TryGetProperty("userType", out JsonElement userType)) return BadRequest();
+            jsonElement.TryGetProperty("userType", out JsonElement _userType);
             //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             //jsonElement.TryGetProperty("site", out JsonElement site);//分开部署,就不需要,一站多用时,取消注释
             var (tmdId, tmdName, pic, _, _, _) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
             var (tmdId, tmdName, pic, _, _, _) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
 
 
@@ -238,10 +238,14 @@ namespace TEAMModelBI.Controllers.BINormal
             //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
             //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
             //}
             //}
             string id = $"{_id}";
             string id = $"{_id}";
+            string userType = "default";
+            if (!string.IsNullOrWhiteSpace($"{_userType}")) 
+            {
+                userType = $"{_userType}";
+            }
+            
             StringBuilder strMsg = new($"{tmdName}[{tmdId}]给");
             StringBuilder strMsg = new($"{tmdName}[{tmdId}]给");
-
             BizUsers bizUsers = new();
             BizUsers bizUsers = new();
-
             List<BizRel> noBizRel = new();
             List<BizRel> noBizRel = new();
 
 
             if ($"{userType}".Equals("tmdId"))
             if ($"{userType}".Equals("tmdId"))
@@ -252,9 +256,11 @@ namespace TEAMModelBI.Controllers.BINormal
                 {
                 {
                     id = Guid.NewGuid().ToString(),
                     id = Guid.NewGuid().ToString(),
                     mobile = long.Parse($"{coreUser.mobile}"),
                     mobile = long.Parse($"{coreUser.mobile}"),
+                    name = coreUser.name,
                     tmdId = coreUser.id,
                     tmdId = coreUser.id,
+                    picture = coreUser.picture,
+                    mail = coreUser.mail,
                     code = "BizUsers",
                     code = "BizUsers",
-                    name = string.IsNullOrEmpty(bizUsers.name) ? bizUsers.mobile.ToString() : bizUsers.name,
                     salt = salt,
                     salt = salt,
                     pwd = string.IsNullOrEmpty(bizUsers.pwd) ? Utils.HashedPassword(bizUsers.mobile.ToString(), salt) : Utils.HashedPassword(bizUsers.pwd, salt),
                     pwd = string.IsNullOrEmpty(bizUsers.pwd) ? Utils.HashedPassword(bizUsers.mobile.ToString(), salt) : Utils.HashedPassword(bizUsers.pwd, salt),
                 };
                 };