feat: 支持邮箱注册功能
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Rbac.Domain.Shared.Enums;
|
||||
|
||||
namespace Yi.Framework.Rbac.Domain.Shared.Caches
|
||||
{
|
||||
public class CaptchaEmailCacheItem
|
||||
{
|
||||
public CaptchaEmailCacheItem(string code)
|
||||
{
|
||||
Code = code;
|
||||
}
|
||||
|
||||
public string Code { get; set; }
|
||||
}
|
||||
|
||||
public class CaptchaEmailCacheKey
|
||||
{
|
||||
public CaptchaEmailCacheKey(ValidationEmailTypeEnum validationPhoneType, string email)
|
||||
{
|
||||
Email = email;
|
||||
ValidationEmailType = validationPhoneType;
|
||||
}
|
||||
|
||||
public ValidationEmailTypeEnum ValidationEmailType { get; set; }
|
||||
public string Email { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Email:{ValidationEmailType.ToString()}:{Email}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace Yi.Framework.Rbac.Domain.Shared.Enums;
|
||||
|
||||
public enum ValidationEmailTypeEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// 注册
|
||||
/// </summary>
|
||||
Register,
|
||||
/// <summary>
|
||||
/// 忘记密码
|
||||
/// </summary>
|
||||
RetrievePassword,
|
||||
/// <summary>
|
||||
/// 绑定
|
||||
/// </summary>
|
||||
Bind
|
||||
}
|
||||
@@ -23,6 +23,11 @@ namespace Yi.Framework.Rbac.Domain.Shared.Options
|
||||
/// </summary>
|
||||
public bool EnableCaptcha { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 验证类型
|
||||
/// </summary>
|
||||
public CaptchaTypeEnum CaptchaType { get; set; } = CaptchaTypeEnum.Phone;
|
||||
|
||||
/// <summary>
|
||||
/// 是否开启用户注册功能
|
||||
/// </summary>
|
||||
@@ -33,4 +38,20 @@ namespace Yi.Framework.Rbac.Domain.Shared.Options
|
||||
/// </summary>
|
||||
public bool EnableDataBaseBackup { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证类型
|
||||
/// </summary>
|
||||
public enum CaptchaTypeEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// 手机号
|
||||
/// </summary>
|
||||
Phone = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱
|
||||
/// </summary>
|
||||
Email = 1,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user