fix 临时调整代码

This commit is contained in:
2024-11-25 11:58:03 +08:00
parent bbaf7aa3be
commit f49404f938
13 changed files with 81 additions and 102 deletions

View File

@@ -6,16 +6,16 @@ namespace Dlhis.ScheduledTask.Packs;
public class JinkoSapHttpClientPack : BaseAppPack
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddHttpClient("jinko:sap", (sp, httpClient) =>
services.AddHttpClient("jinko:sap", (_, httpClient) =>
{
httpClient.BaseAddress = new Uri($"http://sappipap01.jinkosolar.cn:50100");
httpClient.Timeout = TimeSpan.FromMinutes(10);
var credentials = $"{"EHS_USER"}:{"y3R1hd2h*RICAC"}";
const string credentials = "EHS_USER:y3R1hd2h*RICAC";
var headerValue = Convert.ToBase64String(Encoding.UTF8.GetBytes(credentials));
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", headerValue);
});
}
}
}