Skip to content

Commit 8759b59

Browse files
committed
SimApiHttpClientAddServer
1 parent 5a46a02 commit 8759b59

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Helpers/SimApiHttpClient.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace SimApi.Helpers;
99

1010
public class SimApiHttpClient(string? appId, string appKey)
1111
{
12+
public string Server { get; init; } = string.Empty;
1213
public string SignName { get; init; } = "sign";
1314
public string TimestampName { get; init; } = "timestamp";
1415
public string NonceName { get; init; } = "nonce";
@@ -18,6 +19,7 @@ public class SimApiHttpClient(string? appId, string appKey)
1819

1920
public T? SignQuery<T>(string url, object body, Dictionary<string, string>? queries = null)
2021
{
22+
url = Server + url;
2123
var queryUrl = SignFields.Aggregate(string.Empty,
2224
(current, signField) => current + $"{signField}={queries?[signField]}&");
2325
if (!string.IsNullOrEmpty(AppIdName))
@@ -42,6 +44,7 @@ public class SimApiHttpClient(string? appId, string appKey)
4244

4345
public T? AesQuery<T>(string url, object body)
4446
{
47+
url = Server + url;
4548
if (!string.IsNullOrEmpty(AppIdName))
4649
{
4750
url += $"?{AppIdName}={appId}";

0 commit comments

Comments
 (0)