http注释

This commit is contained in:
tongfei
2023-11-13 09:08:28 +08:00
parent 5a9a89ad3f
commit 8a16ea120f

View File

@@ -87,8 +87,6 @@ namespace WMS.Web.Core.Help
public string PostHttp(string url, LoginAuthorizeRequest reqData) public string PostHttp(string url, LoginAuthorizeRequest reqData)
{ {
_logger.LogInformation($"HttpPost->11111111111111111");
var str = string.Format("client_id={0}&client_secret={1}&grant_type={2}&username={3}&password={4}&scope={5}", var str = string.Format("client_id={0}&client_secret={1}&grant_type={2}&username={3}&password={4}&scope={5}",
reqData.ClientId, reqData.ClientSecret, reqData.GrantType, reqData.UserName, reqData.Password,reqData.Scope); reqData.ClientId, reqData.ClientSecret, reqData.GrantType, reqData.UserName, reqData.Password,reqData.Scope);
ASCIIEncoding encoding = new ASCIIEncoding(); ASCIIEncoding encoding = new ASCIIEncoding();
@@ -101,19 +99,16 @@ namespace WMS.Web.Core.Help
HttpClient httpClient = new HttpClient(); HttpClient httpClient = new HttpClient();
httpClient.BaseAddress = new Uri(url); httpClient.BaseAddress = new Uri(url);
httpClient.Timeout = new TimeSpan(0, 0, 10); httpClient.Timeout = new TimeSpan(0, 0, 10);
_logger.LogInformation($"HttpPost-2>"+ str);
HttpResponseMessage response = httpClient.PostAsync(url, httpContent).Result; HttpResponseMessage response = httpClient.PostAsync(url, httpContent).Result;
if (response.IsSuccessStatusCode) if (response.IsSuccessStatusCode)
{ {
var resData = response.Content.ReadAsStringAsync().Result; var resData = response.Content.ReadAsStringAsync().Result;
_logger.LogInformation($"HttpPost-3>" + resData);
return resData; return resData;
} }
else else
{ {
var resData = response.Content.ReadAsStringAsync().Result; var resData = response.Content.ReadAsStringAsync().Result;
_logger.LogInformation($"HttpPost-4>" + resData);
return resData; return resData;
} }