You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
807 B
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace Admin.Core.Common
{
public interface ICaptcha
{
/// <summary>
/// 生成随机验证码
/// </summary>
/// <param name="codeLength"></param>
/// <returns></returns>
Task<string> GenerateRandomCaptcha(int codeLength = 4);
/// <summary>
/// 生成验证码图片
/// </summary>
/// <param name="captchaCode">验证码</param>
/// <param name="width">宽为0将根据验证码长度自动匹配合适宽度</param>
/// <param name="height">高</param>
/// <returns></returns>
Task<CaptchaResult> GenerateCaptchaImage(string captchaCode, int width = 0, int height = 30);
}
}