mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-19 10:08:20 +08:00
docs: 完善文档
This commit is contained in:
@@ -185,4 +185,6 @@ else
|
|||||||
|
|
||||||
## 示例项目
|
## 示例项目
|
||||||
|
|
||||||
- [示例项目说明](./Sample.md)
|
为方便开发者快速掌握本库的使用方法,这里提供一个示例项目以供参考。
|
||||||
|
|
||||||
|
请阅读[《示例项目说明》](./Sample.md)
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
示例项目位于 _samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net5_。
|
示例项目位于 _samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net5_。
|
||||||
|
|
||||||
示例项目基于 .NET 5.0 实现,依赖如下的第三方库:
|
示例项目基于 .NET 5.0 实现,依赖以下第三方库:
|
||||||
|
|
||||||
- [`DistributedLock`](https://github.com/madelson/DistributedLock):分布式锁。
|
- [`DistributedLock`](https://github.com/madelson/DistributedLock):分布式锁。
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 使用须知:
|
### 【重要】使用须知:
|
||||||
|
|
||||||
示例项目仅作为业务上的参考,不代表可直接用于生产。
|
示例项目仅作为业务上的参考,不代表可直接用于生产。
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
#### 3. 容错性:
|
#### 3. 容错性:
|
||||||
|
|
||||||
示例项目中未特殊处理可能产生的异常(如:空指针等),也没有考虑 AccessToken 中控刷新失败等业务逻辑问题,开发者可根据业务需要自行处理。
|
示例项目中未特殊处理可能产生的异常(如:空指针等),也没有考虑 AccessToken 中控刷新失败等业务逻辑问题,开发者可根据业务需要自行实现。
|
||||||
|
|
||||||
#### 4. 安全性:
|
#### 4. 安全性:
|
||||||
|
|
||||||
|
@@ -20,6 +20,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Sample_Net5.Services.HttpClients.Imple
|
|||||||
{
|
{
|
||||||
_httpClientFactory = httpClientFactory;
|
_httpClientFactory = httpClientFactory;
|
||||||
_wechatOptions = wechatOptions.Value;
|
_wechatOptions = wechatOptions.Value;
|
||||||
|
|
||||||
|
FlurlHttp.GlobalSettings.FlurlClientFactory = new DelegatingFlurlClientFactory(_httpClientFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
public WechatApiClient Create(string appId)
|
public WechatApiClient Create(string appId)
|
||||||
@@ -28,8 +30,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Sample_Net5.Services.HttpClients.Imple
|
|||||||
if (wechatAccount == null)
|
if (wechatAccount == null)
|
||||||
throw new Exception("未在配置项中找到该 AppId 对应的微信账号。");
|
throw new Exception("未在配置项中找到该 AppId 对应的微信账号。");
|
||||||
|
|
||||||
FlurlHttp.GlobalSettings.FlurlClientFactory = new DelegatingFlurlClientFactory(_httpClientFactory);
|
|
||||||
|
|
||||||
return new WechatApiClient(new WechatApiClientOptions()
|
return new WechatApiClient(new WechatApiClientOptions()
|
||||||
{
|
{
|
||||||
AppId = wechatAccount.AppId,
|
AppId = wechatAccount.AppId,
|
||||||
|
Reference in New Issue
Block a user