mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2026-02-14 03:56:22 +08:00
feat(work): 新增 Credentials 类型,存储初始化客户端时的凭证副本
This commit is contained in:
@@ -30,7 +30,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "service", "get_provider_token");
|
||||
|
||||
var requestData = new { corpid = client.WechatCorpId, provider_secret = client.WechatAgentSecret };
|
||||
var requestData = new { corpid = client.Credentials.CorpId, provider_secret = client.Credentials.AgentSecret };
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinServiceGetProviderTokenResponse>(flurlReq, data: requestData, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
@@ -49,10 +49,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (string.IsNullOrEmpty(request.SuiteId))
|
||||
request.SuiteId = client.WechatSuiteId;
|
||||
request.SuiteId = client.Credentials.SuiteId;
|
||||
|
||||
if (string.IsNullOrEmpty(request.SuiteSecret))
|
||||
request.SuiteSecret = client.WechatSuiteSecret;
|
||||
request.SuiteSecret = client.Credentials.SuiteSecret;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "service", "get_suite_token");
|
||||
|
||||
Reference in New Issue
Block a user