fix : 서버 설정파일 빼기 작업
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Net;
|
||||
using System.Net.Http.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using MMOserver.Config;
|
||||
using MMOserver.Utils;
|
||||
using Serilog;
|
||||
|
||||
@@ -8,8 +9,6 @@ namespace MMOserver.Api;
|
||||
|
||||
public class RestApi : Singleton<RestApi>
|
||||
{
|
||||
private const string VERIFY_URL = "https://a301.api.tolelom.xyz";
|
||||
private const string INTERNAL_API_KEY = "017f15b28143fc67d2e5bed283c37d2da858b9f294990a5334238e055e3f5425";
|
||||
private readonly HttpClient httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) };
|
||||
|
||||
private const int MAX_RETRY = 3;
|
||||
@@ -17,7 +16,7 @@ public class RestApi : Singleton<RestApi>
|
||||
|
||||
public RestApi()
|
||||
{
|
||||
httpClient.DefaultRequestHeaders.Add("X-API-Key", INTERNAL_API_KEY);
|
||||
httpClient.DefaultRequestHeaders.Add("X-API-Key", AppConfig.RestApi.ApiKey);
|
||||
}
|
||||
|
||||
// 토큰 검증 - 성공 시 username 반환
|
||||
@@ -25,7 +24,7 @@ public class RestApi : Singleton<RestApi>
|
||||
// 타임아웃/네트워크 오류 → 최대 MAX_RETRY회 재시도 후 null 반환
|
||||
public async Task<string?> VerifyTokenAsync(string token)
|
||||
{
|
||||
string url = VERIFY_URL + "/api/internal/auth/verify";
|
||||
string url = AppConfig.RestApi.BaseUrl + AppConfig.RestApi.VerifyToken;
|
||||
for (int attempt = 1; attempt <= MAX_RETRY; attempt++)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user