Browse Source
Merge pull request #18044 from abpframework/salihozkara/fixCaptchaGenerateError
Fix captcha generate error
pull/18045/head
liangshiwei
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
4 deletions
-
modules/cms-kit/src/Volo.CmsKit.Public.Web/Security/Captcha/SimpleMathsCaptchaGenerator.cs
|
|
|
@ -155,10 +155,11 @@ public class SimpleMathsCaptchaGenerator : ISingletonDependency |
|
|
|
var x0 = random.Next(0, img.Width); |
|
|
|
var y0 = random.Next(0, img.Height); |
|
|
|
img.Mutate( |
|
|
|
ctx => ctx |
|
|
|
.DrawLine(options.NoiseRateColor[random.Next(0, options.NoiseRateColor.Length)], |
|
|
|
RandomTextGenerator.GenerateNextFloat(0.5, 1.5), new PointF[] { new Vector2(x0, y0), new Vector2(x0, y0) }) |
|
|
|
); |
|
|
|
ctx => ctx |
|
|
|
.DrawLine(options.NoiseRateColor[random.Next(0, options.NoiseRateColor.Length)], |
|
|
|
RandomTextGenerator.GenerateNextFloat(0.5, 1.5), |
|
|
|
new PointF[] { new Vector2(x0, y0), new Vector2(x0 + 0.005f, y0 + 0.005f) }) |
|
|
|
); |
|
|
|
}); |
|
|
|
|
|
|
|
img.Mutate(x => |
|
|
|
|