diff --git a/Images/CHINESE_G.gif b/Images/CHINESE_G.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ddb653bc6a73b8a0f9580a6da526b9ce768282c9
Binary files /dev/null and b/Images/CHINESE_G.gif differ
diff --git a/Images/CHINESE_N.gif b/Images/CHINESE_N.gif
new file mode 100644
index 0000000000000000000000000000000000000000..fd13797162eece376a307e810becda4765ec2e22
Binary files /dev/null and b/Images/CHINESE_N.gif differ
diff --git a/Lazy.Captcha.Core/CaptchaType.cs b/Lazy.Captcha.Core/CaptchaType.cs
index 7775bfb8fb58a2e09f70a6c73a23b696b652370b..9228795fccee38ced2e187f24fa0821950c94f26 100644
--- a/Lazy.Captcha.Core/CaptchaType.cs
+++ b/Lazy.Captcha.Core/CaptchaType.cs
@@ -11,61 +11,61 @@ namespace Lazy.Captcha.Core.Generator
///
/// 默认(英文字符大小写,数字混合)
///
- DEFAULT,
+ DEFAULT=0,
///
/// 中文
///
- CHINESE,
+ CHINESE=1,
///
/// 数字
///
- NUMBER,
+ NUMBER=2,
///
/// 中文数字小写
///
- NUMBER_ZH_CN,
+ NUMBER_ZH_CN=3,
///
/// 中文数字大写
///
- NUMBER_ZH_HK,
+ NUMBER_ZH_HK=4,
///
/// 英文字符大小写混合
///
- WORD,
+ WORD=5,
///
/// 英文字符小写
///
- WORD_LOWER,
+ WORD_LOWER=6,
///
/// 英文字符大写
///
- WORD_UPPER,
+ WORD_UPPER=7,
///
/// 英文小写,数字混合
///
- WORD_NUMBER_LOWER,
+ WORD_NUMBER_LOWER=8,
///
/// 英文大写,数字混合
///
- WORD_NUMBER_UPPER,
+ WORD_NUMBER_UPPER=9,
///
/// 数字计算
///
- ARITHMETIC,
+ ARITHMETIC=10,
///
/// 数字计算,中文
///
- ARITHMETIC_ZH
+ ARITHMETIC_ZH=11
}
}
\ No newline at end of file
diff --git a/README.md b/README.md
index f123cfbbf24009d6477e66e5338fce606adccf2a..e85b238e9083d3598434cf620ad41f33eae7d878 100644
--- a/README.md
+++ b/README.md
@@ -1,37 +1,36 @@
-## LazyCaptcha
+# LazyCaptcha
+
+## 介绍
-### 介绍
仿[EasyCaptcha](https://gitee.com/ele-admin/EasyCaptcha)和[SimpleCaptcha](https://github.com/1992w/SimpleCaptcha),基于.Net Standard 2.1的图形验证码模块。
-[ **码云地址** ](https://gitee.com/pojianbing/lazy-captcha)
-[ **Github地址** ](https://github.com/pojianbing/LazyCaptcha)
+[码云地址](https://gitee.com/pojianbing/lazy-captcha)
+[Github地址](https://github.com/pojianbing/LazyCaptcha)
### 效果展示
-| CaptchaType | 字体 |静态图 | 动图|
-|---|---|---|---|
-| DEFAULT |Actionj|  |  |
-| WORD |Epilog|  |  |
-| WORD_LOWER|Epilog|  |  |
-| WORD_UPPER|Epilog|  |  |
-| WORD_NUMBER_LOWER|Epilog|  |  |
-| WORD_NUMBER_UPPER|Epilog|  |  |
-| NUMBER|Fresnel|  |  |
-| NUMBER_ZH_CN|kaiti|  |  |
-| NUMBER_ZH_HK|kaiti|  |  |
-| ARITHMETIC|Epilog|  |  |
-| ARITHMETIC_ZH|kaiti|  |  |
-
-
-| 字体 | 图片 | 字体 | 图片 |
-|---|---|---|---|
-| Actionj |  | Epilog|  |
-| Fresnel|  | Headache|  |
-| Kaiti|  | Lexo|  |
-| Prefix|  | Progbot|  |
-|Ransom|  |Robot|  |
-| Scandal|  |
-
-
+| CaptchaType | 字体 | 静态图 | 动图 |
+| --------------------- | ------- | ----------------------------------------------- | ----------------------------------------------- |
+| DEFAULT (0) | Actionj |  |  |
+| CHINESE (1) | kaiti |  |  |
+| NUMBER (2) | Fresnel |  |  |
+| NUMBER_ZH_CN (3) | kaiti |  |  |
+| NUMBER_ZH_HK (4) | kaiti |  |  |
+| WORD (5) | Epilog |  |  |
+| WORD_LOWER (6) | Epilog |  |  |
+| WORD_UPPER (7) | Epilog |  |  |
+| WORD_NUMBER_LOWER (8) | Epilog |  |  |
+| WORD_NUMBER_UPPER (9) | Epilog |  |  |
+| ARITHMETIC (10) | Epilog |  |  |
+| ARITHMETIC_ZH (11) | kaiti |  |  |
+
+| 字体 | 图片 | 字体 | 图片 |
+| ------- | ---------------------------------------- | -------- | ----------------------------------------- |
+| Actionj |  | Epilog |  |
+| Fresnel |  | Headache |  |
+| Kaiti |  | Lexo |  |
+| Prefix |  | Progbot |  |
+| Ransom |  | Robot |  |
+| Scandal |  |
### 在线演示(仅学习和试用,随时可能关掉服务)
@@ -44,8 +43,6 @@ http://wosperry.com.cn:8006/captcha/validate?id=999&code=uyfx
```
-
-
### 安装
- [Package Manager](https://www.nuget.org/packages/Lazy.Captcha.Core)
@@ -60,17 +57,15 @@ Install-Package Lazy.Captcha.Core
dotnet add package Lazy.Captcha.Core
```
-
-
### 使用说明
#### 1. 注册服务
-```csharp
+``` csharp
// 默认使用内存存储(AddDistributedMemoryCache)
builder.Services.AddCaptcha(builder.Configuration);
-// 如果使用redis存储
+// 如果使用redis分布式缓存
//builder.Services.AddStackExchangeRedisCache(options =>
//{
// options.Configuration = builder.Configuration.GetConnectionString("RedisCache");
@@ -79,8 +74,10 @@ builder.Services.AddCaptcha(builder.Configuration);
```
-#### 2. 配置
-- ##### appsettings.json (不提供配置时,使用默认配置)
+## 2. 配置
+
+#### appsettings.json (不提供配置时,使用默认配置)
+
``` json
{
"ConnectionStrings": {
@@ -109,8 +106,10 @@ builder.Services.AddCaptcha(builder.Configuration);
}
}
```
-- ##### 代码配置
-```csharp
+
+#### 代码配置
+
+``` csharp
// 全部配置
builder.Services.AddCaptcha(builder.Configuration, option =>
{
@@ -137,11 +136,10 @@ builder.Services.AddCaptcha(builder.Configuration, option =>
option.ImageOption.FontFamily = DefaultFontFamilys.Instance.Scandal; // 字体,中文使用kaiti,其他字符可根据喜好设置(可能部分转字符会出现绘制不出的情况)。
});
```
-> **appsettings.json配置和代码配置同时设置时,代码配置会覆盖appsettings.json配置。**
-
+
#### 3. Controller
-```csharp
+``` csharp
[ApiController]
[Route("api/captcha")]
@@ -175,6 +173,3 @@ builder.Services.AddCaptcha(builder.Configuration, option =>
}
}
```
-
-
-