邮箱正则配置到配置文件

This commit is contained in:
2025-07-04 11:28:56 +08:00
parent 43339ba6e0
commit 57ab098e12
14 changed files with 159 additions and 33 deletions
@@ -70,8 +70,9 @@ namespace IRaCIS.Core.Application.Contracts
[AllowAnonymous]
public async Task<IResponseOutput> SendEmialVerifyCode(SendEmialVerifyCodeInDto userInfo)
{
var emailRegexStr = _systemEmailConfig.EmailRegexStr;
//检查手机或者邮箱是否有效
if (!Regex.IsMatch(userInfo.Email, @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"))
if (!Regex.IsMatch(userInfo.Email, emailRegexStr))
{
//---请输入正确的邮箱地址。
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_InvalidEmail"]);
@@ -271,8 +272,10 @@ namespace IRaCIS.Core.Application.Contracts
[AllowAnonymous]
public async Task<IResponseOutput> SendVerifyCode(SiteSurveySendVerifyCode userInfo)
{
var emailRegexStr = _systemEmailConfig.EmailRegexStr;
//检查手机或者邮箱是否有效
if (!Regex.IsMatch(userInfo.Email, @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"))
if (!Regex.IsMatch(userInfo.Email, emailRegexStr))
{
//---请输入正确的邮箱地址。
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_InvalidEmail"]);