refactor 优化代码

This commit is contained in:
2024-11-26 15:26:12 +08:00
parent a32910f0d9
commit 623a5c4e49
88 changed files with 1820 additions and 941 deletions

View File

@@ -0,0 +1,21 @@
using System.Net.Http.Headers;
using System.Text;
using Kurisu.AspNetCore.Startup;
namespace Dlhis.Basic;
public class JinkoSapHttpClientPack : BaseAppPack
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddHttpClient("jinko:sap", (_, httpClient) =>
{
httpClient.BaseAddress = new Uri($"http://sappipap01.jinkosolar.cn:50100");
httpClient.Timeout = TimeSpan.FromMinutes(10);
const string credentials = "EHS_USER:y3R1hd2h*RICAC";
var headerValue = Convert.ToBase64String(Encoding.UTF8.GetBytes(credentials));
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", headerValue);
});
}
}