修复bug

This commit is contained in:
18942506660
2024-10-17 10:05:32 +08:00
parent f85e04fe97
commit 7499682041
10 changed files with 122 additions and 14 deletions

View File

@@ -1,4 +1,5 @@
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
@@ -48,8 +49,9 @@ namespace WMS.Web.Domain.Services.Public
var responseContent = await response.Content.ReadAsStringAsync(); //2.当前使用这里是为了迎合错误信息观看
if (response.IsSuccessStatusCode)
{
var t = JsonSerializer.Deserialize<T>(responseContent, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
//var t = JsonSerializer.Deserialize<T>(responseContent, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
//var t = await JsonSerializer.DeserializeAsync<T>(responseContent, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });//3.配合1的ReadAsStream使用
var t = JsonConvert.DeserializeObject<T>(responseContent);
return t;
}
@@ -80,8 +82,9 @@ namespace WMS.Web.Domain.Services.Public
var responseContent = await response.Content.ReadAsStringAsync(); //2.当前使用这里是为了迎合错误信息观看
if (response.IsSuccessStatusCode)
{
var t = JsonSerializer.Deserialize<T>(responseContent, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
//var t = JsonSerializer.Deserialize<T>(responseContent, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
//var t = await JsonSerializer.DeserializeAsync<T>(responseContent, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });//3.配合1的ReadAsStream使用
var t = JsonConvert.DeserializeObject<T>(responseContent);
return t;
}
@@ -111,7 +114,8 @@ namespace WMS.Web.Domain.Services.Public
var responseContent = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
var t = JsonSerializer.Deserialize<T>(responseContent, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
//var t = JsonSerializer.Deserialize<T>(responseContent, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
var t = JsonConvert.DeserializeObject<T>(responseContent);
return t;
}
@@ -135,7 +139,8 @@ namespace WMS.Web.Domain.Services.Public
var responseContent = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
var t = JsonSerializer.Deserialize<T>(responseContent, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
//var t = JsonSerializer.Deserialize<T>(responseContent, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
var t = JsonConvert.DeserializeObject<T>(responseContent);
if (t == null)
_logger.LogInformation($"获取单点数据为空---{responseContent}");
return t;
@@ -163,8 +168,8 @@ namespace WMS.Web.Domain.Services.Public
var responseContent = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
var t = JsonSerializer.Deserialize<T>(responseContent, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
//var t = JsonSerializer.Deserialize<T>(responseContent, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
var t = JsonConvert.DeserializeObject<T>(responseContent);
return t;
}