Skip to content

Commit

Permalink
使用统一的SetToken
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Jun 3, 2024
1 parent b257bf0 commit 9acd97d
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions NewLife.Remoting/Clients/HttpClientBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ public void AddServices(String urls)
/// <returns></returns>
public override Task<TResult> OnInvokeAsync<TResult>(String action, Object? args, CancellationToken cancellationToken)
{
_client.Tracer = Tracer;
_client.Log = Log;

if (args == null || action.StartsWithIgnoreCase("Get") || action.Contains("/Get"))
return _client.GetAsync<TResult>(action, args);

Check warning on line 72 in NewLife.Remoting/Clients/HttpClientBase.cs

View workflow job for this annotation

GitHub Actions / test

Nullability of reference types in value of type 'Task<TResult?>' doesn't match target type 'Task<TResult>'.
else
Expand All @@ -82,20 +85,6 @@ protected override void SetToken(String? token)
#endregion

#region 登录
/// <summary>登录</summary>
/// <returns></returns>
public override async Task<LoginResponse?> Login()
{
_client.Tracer = Tracer;
_client.Token = null;

var rs = await base.Login();

_client.Token = rs?.Token;

return rs;
}

/// <summary>登录</summary>
/// <param name="request">登录信息</param>
/// <returns></returns>
Expand Down

0 comments on commit 9acd97d

Please sign in to comment.