fix: images bug

master
Tongg 8 months ago
parent aa54652617
commit eebbe56306
  1. 9
      Model/Services/SOCClientService.cs

@ -255,6 +255,11 @@ namespace SparkClient.Model.Services
int imageTotal = ConfigurationHelper.ReadConfigValueToInteger("DetectImageTotal", 100); int imageTotal = ConfigurationHelper.ReadConfigValueToInteger("DetectImageTotal", 100);
while (true) while (true)
{ {
if (imageIndex >= imageTotal)
{
return imageNames;
}
string url = $"{_baseUrl}/retrieve_image/{imageIndex}"; string url = $"{_baseUrl}/retrieve_image/{imageIndex}";
string sendCode = url.GenerateSign(); string sendCode = url.GenerateSign();
try try
@ -290,7 +295,7 @@ namespace SparkClient.Model.Services
case 404: case 404:
// 资源未找到,结束循环 // 资源未找到,结束循环
Logger.Info($"[SendCode={sendCode}] Image Not Found]"); Logger.Info($"[SendCode={sendCode}] Image Not Found.");
break; break;
//return imageNames; //return imageNames;
default: default:
@ -425,7 +430,7 @@ namespace SparkClient.Model.Services
// 图片文件读取失败 // 图片文件读取失败
return new SocResultEntity { Status = StatusCodes.ImageFileReadFailure, Images = new List<string>() }; return new SocResultEntity { Status = StatusCodes.ImageFileReadFailure, Images = new List<string>() };
} }
return new SocResultEntity { Status = acquisitionStatus, Images = imageNames, DeviceId = entity.Content.device_id}; return new SocResultEntity { Status = "S000", Images = imageNames, DeviceId = entity.Content.device_id};
} }
catch (Exception e) catch (Exception e)
{ {

Loading…
Cancel
Save