Jelszó módosítása

This commit is contained in:
2025-04-14 12:31:50 +02:00
parent 44e6719c3d
commit 29200ae418
18 changed files with 676 additions and 9 deletions
@@ -0,0 +1,42 @@
using Serilog;
using System.Net.Http;
using WorkFlowCheck.Common.DTO;
namespace WorkFlowCheck.Web.Helpers
{
public static class SystemHelper
{
public static string DatabaseName = "";
public async static Task GetAPIInfoAsync(IConfiguration configuration)
{
using (var httpClient = new HttpClient())
{
var apiBaseUrl = configuration["ApiBaseUrl"]; // API-cím elérése a konfigurációból
httpClient.BaseAddress = new Uri(apiBaseUrl);
var apiKey = configuration["ApiKey"];
httpClient.DefaultRequestHeaders.Add("X-Api-Key", apiKey);
string endpoint = $"{httpClient.BaseAddress}api/System/GetDatabaseAndVersionInfo";
var retVal = new RoleDTO();
try
{
var response = await httpClient.GetFromJsonAsync<ApiResponseDTO<string>>(endpoint);
if (response != null)
{
if (response.IsSuccess)
{
DatabaseName = response.Data;
}
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
}
}
}
}