Browse Source

Merge pull request #18044 from abpframework/salihozkara/fixCaptchaGenerateError

Fix captcha generate error
pull/18045/head
liangshiwei 3 years ago
committed by GitHub
parent
commit
fca0e1a961
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Security/Captcha/SimpleMathsCaptchaGenerator.cs

9
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 x0 = random.Next(0, img.Width);
var y0 = random.Next(0, img.Height); var y0 = random.Next(0, img.Height);
img.Mutate( img.Mutate(
ctx => ctx ctx => ctx
.DrawLine(options.NoiseRateColor[random.Next(0, options.NoiseRateColor.Length)], .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) }) RandomTextGenerator.GenerateNextFloat(0.5, 1.5),
); new PointF[] { new Vector2(x0, y0), new Vector2(x0 + 0.005f, y0 + 0.005f) })
);
}); });
img.Mutate(x => img.Mutate(x =>

Loading…
Cancel
Save