Jelszó módosítása
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user