feat(work): 新增 Credentials 类型,存储初始化客户端时的凭证副本

This commit is contained in:
Fu Diwei
2021-07-27 00:50:28 +08:00
parent 02a06c8106
commit d039a74f3d
12 changed files with 79 additions and 64 deletions

View File

@@ -26,8 +26,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Get, "cgi-bin", "gettoken")
.SetQueryParam("corpid", client.WechatCorpId)
.SetQueryParam("corpsecret", client.WechatAgentSecret);
.SetQueryParam("corpid", client.Credentials.CorpId)
.SetQueryParam("corpsecret", client.Credentials.AgentSecret);
return await client.SendRequestWithJsonAsync<Models.CgibinGetTokenResponse>(flurlReq, cancellationToken: cancellationToken);
}