20231221获取人员接口 按照图片二进制更新

This commit is contained in:
杨红卫 2023-12-21 17:45:54 +08:00
parent 38aea9bbc5
commit 1f08356eb1
1 changed files with 12 additions and 23 deletions

View File

@ -266,16 +266,6 @@ namespace WebAPI.Controllers
}
else
{
if (string.IsNullOrEmpty(getPerson.PhotoUrl) && (person.headImage.Length > 0 || !string.IsNullOrEmpty(person.PhotoUrl)))
{
if (person.headImage.Length == 0 && !string.IsNullOrEmpty(person.PhotoUrl))
{
var getS = AttachFileService.SetImageToByteArray(person.PhotoUrl);
if (getS != null)
{
person.headImage = getS.ToString();
}
}
if (person.headImage.Length > 0)
{
var image = Convert.FromBase64String(person.headImage);
@ -291,7 +281,6 @@ namespace WebAPI.Controllers
getPerson.PhotoUrl = path + flieName;
System.IO.File.WriteAllBytes((fileUrl + flieName), image);
//AttachFileService.Base64ToImage(person.headImage, path, person.PersonName);
}
db.SubmitChanges();
responeData.message = "更新照片!";
}