From 3de2321461ec689213a53b816cb89d83ca1d1094 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 31 May 2022 16:40:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=97=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/Controllers/ExtraController.cs | 7 ++++++- .../Service/Common/DTO/DictionaryModel.cs | 2 +- .../Service/Common/DictionaryService.cs | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) 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()); }