邮箱正则配置到配置文件
This commit is contained in:
@@ -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"]);
|
||||
|
||||
Reference in New Issue
Block a user