diff --git a/IRaCIS.Core.API/Controllers/ExtraController.cs b/IRaCIS.Core.API/Controllers/ExtraController.cs index ec41c5392..de794f017 100644 --- a/IRaCIS.Core.API/Controllers/ExtraController.cs +++ b/IRaCIS.Core.API/Controllers/ExtraController.cs @@ -23,6 +23,7 @@ using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Infrastructure; using System.Linq; +using Microsoft.Extensions.Logging; namespace IRaCIS.Api.Controllers { @@ -195,7 +196,7 @@ namespace IRaCIS.Api.Controllers [HttpGet("User/UserRedirect")] [AllowAnonymous] - public async Task UserRedirect([FromServices] IRepository _userRepository, string url) + public async Task UserRedirect([FromServices] IRepository _userRepository, string url ,[FromServices]ILogger _logger) { var decodeUrl = System.Web.HttpUtility.UrlDecode(url); @@ -208,9 +209,13 @@ namespace IRaCIS.Api.Controllers var errorUrl = domainStrList[0]+"//"+ domainStrList[2]+ "/error"; + _logger.LogError(errorUrl); + if (!await _userRepository.AnyAsync(t => t.Id == Guid.Parse(userId) && t.EmailToken == token && t.IsFirstAdd)) { decodeUrl = errorUrl+ "?ErrorMessage=您的初始化链接已过期"; + + _logger.LogError(errorUrl); } return Redirect(decodeUrl); diff --git a/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs index 70cfe265a..7f5d755d2 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs @@ -74,7 +74,7 @@ namespace IRaCIS.Application.Contracts public DicDataTypeEnum DataTypeEnum { get; set; } - public bool IsEnumInt => System.Text.RegularExpressions.Regex.IsMatch(Code, @"^\d*$"); + public bool IsEnumInt => System.Text.RegularExpressions.Regex.IsMatch(Code, @"^\d*$") && DataTypeEnum== DicDataTypeEnum.Enum; } diff --git a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs index bc9e9d905..ef5c61a11 100644 --- a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs +++ b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs @@ -182,7 +182,7 @@ namespace IRaCIS.Application.Services [AllowAnonymous] public async Task>> GetBasicDataAllSelect() { - var searchList = await _dicRepository.Where(t => t.ParentId != null && t.IsEnable).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + var searchList = await _dicRepository.Where(t => t.ParentId != null && t.IsEnable ).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); return searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.OrderBy(t => t.ShowOrder).ToList()); }