修改邮箱配置校验

Test_IRC_Net8
hang 2025-07-21 14:23:09 +08:00
parent bae6f099fe
commit f2836a8928
6 changed files with 9 additions and 4 deletions

View File

@ -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": {

View File

@ -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" ]
},

View File

@ -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" ]
},

View File

@ -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" ]
},

View File

@ -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))
{
//---请输入一个正确的邮箱。

View File

@ -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)