修改邮箱配置校验
parent
bae6f099fe
commit
f2836a8928
|
@ -72,6 +72,7 @@
|
|||
"CompanyShortNameCN": "展影医疗",
|
||||
"IsEnv_US": false,
|
||||
"IsOpenErrorNoticeEmail": false,
|
||||
"EmailRegexStr": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
|
||||
"ErrorNoticeEmailList": [ "872297557@qq.com" ]
|
||||
},
|
||||
"SystemPacsConfig": {
|
||||
|
|
|
@ -78,6 +78,7 @@
|
|||
"SiteUrl": "https://lili.elevateimaging.ai/login",
|
||||
"IsEnv_US": true,
|
||||
"IsOpenErrorNoticeEmail": false,
|
||||
"EmailRegexStr": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
|
||||
"ErrorNoticeEmailList": [ "872297557@qq.com" ]
|
||||
},
|
||||
|
||||
|
|
|
@ -85,6 +85,7 @@
|
|||
"SiteUrl": "https://lili.uat.elevateimaging.ai/login",
|
||||
"IsEnv_US": true,
|
||||
"IsOpenErrorNoticeEmail": false,
|
||||
"EmailRegexStr": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
|
||||
"ErrorNoticeEmailList": [ "872297557@qq.com" ]
|
||||
},
|
||||
|
||||
|
|
|
@ -92,6 +92,7 @@
|
|||
"CompanyShortNameCN": "展影医疗",
|
||||
"IsEnv_US": false,
|
||||
"IsOpenErrorNoticeEmail": false,
|
||||
"EmailRegexStr": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
|
||||
"ErrorNoticeEmailList": [ "872297557@qq.com" ]
|
||||
},
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
|
||||
//检查手机或者邮箱是否有效
|
||||
if (!Regex.IsMatch(email, @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"))
|
||||
if (!Regex.IsMatch(email, _systemEmailConfig.EmailRegexStr))
|
||||
{
|
||||
//---Please input a legal email
|
||||
return ResponseOutput.NotOk(_localizer["User_LegalEmail"]);
|
||||
|
@ -325,7 +325,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
|
||||
//检查手机或者邮箱是否有效
|
||||
if (!Regex.IsMatch(email, @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"))
|
||||
if (!Regex.IsMatch(email, _systemEmailConfig.EmailRegexStr))
|
||||
{
|
||||
|
||||
//---请输入一个正确的邮箱。
|
||||
|
|
|
@ -5,6 +5,7 @@ using IRaCIS.Core.Domain.Models;
|
|||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
|
@ -24,7 +25,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
IRepository<TrialExperience> _trialExperienceRepository,
|
||||
|
||||
IRepository<Dictionary> _dictionaryRepository,
|
||||
|
||||
IOptionsMonitor<SystemEmailSendConfig> _systemEmailConfig,
|
||||
IRepository<TrialExperienceCriteria> _trialExperienceCriteriaRepository,
|
||||
IMailVerificationService _mailVerificationService, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IEnrollService
|
||||
{
|
||||
|
@ -385,7 +386,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.Select(t => new { t.EMail, t.FirstName, t.LastName }).ToListAsync();
|
||||
|
||||
|
||||
var errorList = emaiList.Where(t => !Regex.IsMatch(t.EMail, @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"))
|
||||
var errorList = emaiList.Where(t => !Regex.IsMatch(t.EMail, _systemEmailConfig.CurrentValue.EmailRegexStr))
|
||||
.ToList();
|
||||
|
||||
if (errorList.Count() > 0)
|
||||
|
|
Loading…
Reference in New Issue